Relewise.Client.Extensions 1.5.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Relewise.Client.Extensions --version 1.5.0
NuGet\Install-Package Relewise.Client.Extensions -Version 1.5.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Relewise.Client.Extensions" Version="1.5.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Relewise.Client.Extensions --version 1.5.0
#r "nuget: Relewise.Client.Extensions, 1.5.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 GitHub license NuGet version PRs Welcome

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 and Timeout for the individual client instances of ITracker, IRecommender and ISearcher.
  • 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Relewise.Client.Extensions:

Package Downloads
Relewise.Integrations.Umbraco The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

An extension for Umbraco CMS allowing easy content export to Relewise

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.0 290 3/2/2024
1.4.2 10,824 9/26/2023
1.4.1 3,061 8/29/2023
1.4.0 7,135 8/17/2023
1.3.1 20,524 9/28/2022
1.3.0 483 9/8/2022
1.2.1 386 8/31/2022
1.2.0 623 8/31/2022
1.1.0 2,364 5/31/2022
1.0.0 507 5/23/2022