Relewise.Client.Extensions
1.5.0
Prefix Reserved
dotnet add package Relewise.Client.Extensions --version 1.5.0
NuGet\Install-Package Relewise.Client.Extensions -Version 1.5.0
<PackageReference Include="Relewise.Client.Extensions" Version="1.5.0" />
paket add Relewise.Client.Extensions --version 1.5.0
#r "nuget: Relewise.Client.Extensions, 1.5.0"
// Install Relewise.Client.Extensions as a Cake Addin #addin nuget:?package=Relewise.Client.Extensions&version=1.5.0 // Install Relewise.Client.Extensions as a Cake Tool #tool nuget:?package=Relewise.Client.Extensions&version=1.5.0
Relewise.Client.Extensions
Relewise.Client.Extensions
You should install Relewise.Client.Extensions using NuGet:
Install-Package Relewise.Client.Extensions
Run this command from the NuGet Package Manager Console to install the NuGet package.
Features
Dependency Injection / Wiring up Relewise clients
We provide a lot of ways to easily add the clients you need. The default way to do that is using the following code:
services.AddRelewise(options =>
{
options.DatasetId = Guid.Parse("1B5A09DB-561E-47E0-B8ED-4E559A1B7EB9");
options.ApiKey = "r4FqfMqtiZjJmoN";
options.Timeout = TimeSpan.FromSeconds(3);
});
This will wire up the client instances of ITracker
, IRecommender
and ISearcher
, and these clients will all be configured for the DatasetId
and ApiKey
options specificed above, and with a request timeout of 3 seconds.
Optionally, it is possible to define a ServerUrl
for the client to target. If no value is provided the client will by default target the main Relewise server.
We recommend that the DatasetId
, ApiKey
and ServerUrl
are stored in a configuration-file. We provide a default way of reading from the appsettings.json, see options.ReadFromConfiguration(configuration)
below:
IConfiguration configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development"}.json", true)
.Build();
services.AddRelewise(options => options.ReadFromConfiguration(configuration));
The configuration offers a lot of other great features, such as
- Set specific options for
DatasetId
,ApiKey
,ServerUrl
andTimeout
for the individual client instances ofITracker
,IRecommender
andISearcher
. - Named clients to allow different configuration for integrations etc or to use for a multi site-setup.
Here is a full example of all the configuration settings we provide via the appsettings or via the fluent API:
"Relewise": {
"DatasetId": "<<dataset-id>>",
"ApiKey": "<<api-key>>",
"Timeout": "00:00:03",
"ServerUrl": "<<server-url>>",
"Tracker": {
"Timeout": "00:00:10"
},
"Recommender": {
"Timeout": "00:00:05"
},
"Searcher": {
"Timeout": "00:00:10"
},
"Named": {
"Integration": {
"Tracker": {
"Timeout": "00:00:30"
}
},
"ContentSite": {
"DatasetId": "<<dataset-id>>",
"ApiKey": "<<api-key>>",
"ServerUrl": "<<server-url>>",
"Timeout": "00:00:03",
"Tracker": {
"Timeout": "00:00:10"
},
"Recommender": {
"Timeout": "00:00:05"
},
"Searcher": {
"Timeout": "00:00:10"
}
}
}
}
When using named clients, you can use the IRelewiseClientFactory
to retrieve an instance of ITracker
, IRecommender
and ISearcher
:
IRelewiseClientFactory factory = provider.GetRequiredService<IRelewiseClientFactory>();
ITracker tracker = factory.GetClient<ITracker>("Integration");
Contributing
Pull requests are always welcome.
Please fork this repository and make a PR when you are ready with your contribution.
Otherwise you are welcome to open an Issue in our issue tracker.
License
Relewise.Client.Extensions is licensed under the MIT license
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 7.0.0 && < 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4 && < 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0 && < 9.0.0)
- Relewise.Client (>= 1.25.0 && < 2.0.0)
-
net6.0
- Microsoft.Extensions.Configuration (>= 7.0.0 && < 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4 && < 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0 && < 9.0.0)
- Relewise.Client (>= 1.25.0 && < 2.0.0)
-
net7.0
- Microsoft.Extensions.Configuration (>= 7.0.0 && < 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4 && < 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0 && < 9.0.0)
- Relewise.Client (>= 1.25.0 && < 2.0.0)
-
net8.0
- Microsoft.Extensions.Configuration (>= 7.0.0 && < 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4 && < 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0 && < 9.0.0)
- Relewise.Client (>= 1.25.0 && < 2.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Relewise.Client.Extensions:
Package | Downloads |
---|---|
Relewise.Integrations.Umbraco
An extension for Umbraco CMS allowing easy content export to Relewise |
GitHub repositories
This package is not used by any popular GitHub repositories.