Activity Feeds V3 is in closed alpha — do not use it in production (just yet).

Installation

NuGet Package Manager

NuGet\Install-Package getstream-net -Version 1.2.0

.NET CLI

dotnet add package getstream-net --version 1.2.0

PackageReference

Add the following to your .csproj file:

<PackageReference Include="getstream-net" Version="1.2.0" />

GitHub repository: https://github.com/GetStream/getstream-net. Feel free to submit bug reports and feature requests.

The package is tested against these environments:

  • .NET Framework 4.6.2+
  • .NET Core 3.1+
  • .NET 5.0+
  • .NET 6.0+
  • .NET 7.0+
  • .NET 8.0+

To create a client, you’ll need your API key and secret. Both of them can be found in your Stream Dashboard.

You can optionally pass a timeout for the API requests, the default timeout is 6000ms.

using Stream;
using Stream.Models;

class Program
{
    static async Task Main(string[] args)
    {
        string apiKey = "";
        string secret = "";

        // Create client with default timeout (6000ms)
        var client = new StreamClient(apiKey, secret);

        // Or create client with custom timeout (3 seconds)
        var clientWithTimeout = new StreamClient(apiKey, secret, new StreamClientOptions
        {
            Timeout = TimeSpan.FromSeconds(3)
        });

        // Get the feeds client
        var feedsClient = client.Feeds;

        // Your feeds operations here...
    }
}

Alternative initialization

You can also initialize the client using configuration:

using Stream;
using Microsoft.Extensions.Configuration;

// Using configuration
var configuration = new ConfigurationBuilder()
    .AddJsonFile("appsettings.json")
    .Build();

var client = new StreamClient(
    configuration["Stream:ApiKey"],
    configuration["Stream:Secret"],
    new StreamClientOptions
    {
        Location = "us-east",
        Timeout = TimeSpan.FromSeconds(3)
    }
);
© Getstream.io, Inc. All Rights Reserved.