Skip to content

Commit

Permalink
fix: Fix Statsig nuget package name (#172)
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Henneberg <[email protected]>
  • Loading branch information
jenshenneberg authored Apr 8, 2024
1 parent d85eb95 commit 3d089f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageId>OpenFeature.Contrib.Provider.Statsig</PackageId>
<PackageId>OpenFeature.Contrib.Providers.Statsig</PackageId>
<VersionNumber>0.0.3</VersionNumber><!--x-release-please-version -->
<VersionPrefix>$(VersionNumber)</VersionPrefix>
<VersionSuffix>preview</VersionSuffix>
Expand Down
27 changes: 15 additions & 12 deletions src/OpenFeature.Contrib.Providers.Statsig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ The first things we will do is install the **Open Feature SDK** and the **Statsi

### .NET Cli
```shell
dotnet add package OpenFeature.Contrib.Provider.Statsig
dotnet add package OpenFeature.Contrib.Providers.Statsig
```
### Package Manager

```shell
NuGet\Install-Package OpenFeature.Contrib.Provider.Statsig
NuGet\Install-Package OpenFeature.Contrib.Providers.Statsig
```
### Package Reference

```xml
<PackageReference Include=" OpenFeature.Contrib.Provider.Statsig" />
<PackageReference Include=" OpenFeature.Contrib.Providers.Statsig" />
```
### Packet cli

```shell
paket add OpenFeature.Contrib.Provider.Statsig
paket add OpenFeature.Contrib.Providers.Statsig
```

### Cake

```shell
// Install OpenFeature.Contrib.Provider.Statsig as a Cake Addin
#addin nuget:?package= OpenFeature.Contrib.Provider.Statsig
// Install OpenFeature.Contrib.Providers.Statsig as a Cake Addin
#addin nuget:?package= OpenFeature.Contrib.Providers.Statsig

// Install OpenFeature.Contrib.Provider.Statsig as a Cake Tool
#tool nuget:?package= OpenFeature.Contrib.Provider.Statsig
// Install OpenFeature.Contrib.Providers.Statsig as a Cake Tool
#tool nuget:?package= OpenFeature.Contrib.Providers.Statsig
```

## Using the Statsig Provider with the OpenFeature SDK
Expand All @@ -44,15 +44,18 @@ The following example shows how to use the Statsig provider with the OpenFeature

```csharp
using OpenFeature;
using OpenFeature.Contrib.Provider.Statsig;
using OpenFeature.Contrib.Providers.Statsig;
using System;

StatsigProvider statsigProvider = new StatsigProvider("#YOUR-SDK-KEY#");

// Set the statsigProvider as the provider for the OpenFeature SDK
await Api.Instance.SetProviderAsync(statsigProvider);

IFeatureClient client = OpenFeature.Api.Instance.GetClient();
var eb = EvaluationContext.Builder();
eb.SetTargetingKey("[email protected]");

IFeatureClient client = Api.Instance.GetClient(context: eb.Build());

bool isMyAwesomeFeatureEnabled = await client.GetBooleanValue("isMyAwesomeFeatureEnabled", false);

Expand All @@ -65,10 +68,10 @@ if (isMyAwesomeFeatureEnabled)

### Customizing the Statsig Provider

The Statsig provider can be customized by passing a `Action<StatsigServerOptions>` object to the constructor.
The Statsig provider can be customized by passing a `StatsigServerOptions` object to the constructor.

```csharp
var statsigProvider = new StatsigProvider("#YOUR-SDK-KEY#", options => options.LocalMode = true);
var statsigProvider = new StatsigProvider("#YOUR-SDK-KEY#", new StatsigServerOptions() { LocalMode = true });
```

For a full list of options see the [Statsig documentation](https://docs.statsig.com/server/dotnetSDK#statsig-options).
Expand Down

0 comments on commit 3d089f5

Please sign in to comment.