Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions website/docs/sdk-reference/dotnet/_template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ using ConfigCat.Extensions.Hosting;
{
configCatBuilder.AddDefaultClient(options =>
{
options.SdkKey = "#YOUR-SDK-KEY#";
options.SdkKey = "#YOUR-SDK-KEY#";
});
});
```
Expand Down Expand Up @@ -301,10 +301,10 @@ using ConfigCat.Extensions.Hosting;
```csharp
services.AddConfigCat(configCatBuilder =>
{
configCatBuilder.AddDefaultClient(options =>
{
options.SdkKey = "#YOUR-SDK-KEY#";
});
configCatBuilder.AddDefaultClient(options =>
{
options.SdkKey = "#YOUR-SDK-KEY#";
});
});
```

Expand Down
35 changes: 21 additions & 14 deletions website/docs/sdk-reference/openfeature/dotnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: ConfigCat OpenFeature Provider for .NET. This is a step-by-step gui
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<a href="https://github.com/open-feature/dotnet-sdk-contrib/tree/OpenFeature.Contrib.Providers.ConfigCat-v0.1.1/src/OpenFeature.Contrib.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider for .NET on GitHub</a>
<a href="https://github.com/open-feature/dotnet-sdk-contrib/tree/main/src/OpenFeature.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider for .NET on GitHub</a>

## Getting started

Expand All @@ -17,21 +17,21 @@ import TabItem from '@theme/TabItem';
<TabItem value="Powershell / NuGet Package Manager Console" label="Powershell / NuGet Package Manager Console">

```powershell
Install-Package OpenFeature.Contrib.Providers.ConfigCat
Install-Package OpenFeature.Providers.ConfigCat
```

</TabItem>
<TabItem value=".NET CLI" label=".NET CLI">

```bash
dotnet add package OpenFeature.Contrib.Providers.ConfigCat
dotnet add package OpenFeature.Providers.ConfigCat
```

</TabItem>
<TabItem value="Package Reference" label="Package Reference">

```xml
<PackageReference Include="OpenFeature.Contrib.Providers.ConfigCat" />
<PackageReference Include="OpenFeature.Providers.ConfigCat" />
```

</TabItem>
Expand All @@ -43,7 +43,7 @@ The `ConfigCatProvider` constructor takes the SDK key and an optional callback t
```cs
using System;
using ConfigCat.Client;
using OpenFeature.Contrib.ConfigCat;
using OpenFeature.Providers.ConfigCat;

// Specify options for the ConfigCat SDK.
Action<ConfigCat.Client.Configuration.ConfigCatClientOptions> configureOptions = (options) =>
Expand Down Expand Up @@ -91,18 +91,25 @@ The ConfigCat provider translates these evaluation contexts to ConfigCat [User O

The following table shows how the different context attributes are mapped to User Object attributes.

| Evaluation context | User Object | Required |
| ------------------ | ------------ | -------- |
| `Id`/`Identifier` | `Identifier` | &#9745; |
| `Email` | `Email` | |
| `Country` | `Country` | |
| Any other | `Custom` | |
| Evaluation context | User Object | Required |
| ------------------------------------ | ------------ | -------- |
| `targetingKey` (`Id` / `Identifier`) | `Identifier` | &#9745; |
| `Email` | `Email` | |
| `Country` | `Country` | |
| Any other | `Custom` | |

Remarks:
- If `targetingKey` is present in the evaluation context, it will be mapped to the `Identifier` property. Otherwise, `Id` or `Identifier` will be mapped, whichever occurs first.
(If none of these keys are present, the `Identifier` property will be set to the fallback value `"<n/a>"`.)
- The keys `Id`, `Identifier`, `Email` and `Country` are matched case-insensitively. If the same key appears in multiple cases - e.g. `email` and `Email` - the first occurrence will be mapped to the corresponding property.
- All of the above will also be included in the `Custom` dictionary (except for the exact keys `Identifier`, `Email` and `Country`). This allows them to be referenced using their original names in feature flag rules.
- Other keys are mapped as custom user attributes with their values unchanged. (Although the ConfigCat SDK handles value conversion internally, it's recommended to use the type expected by the referencing feature flag rules. Read more [here](../../dotnet/#user-object-attribute-types).)

To evaluate feature flags for a context, use the <a href="https://openfeature.dev/docs/reference/concepts/evaluation-api/" target="_blank">OpenFeature Evaluation API</a>:

```cs
var context = OpenFeature.Model.EvaluationContext.Builder()
.Set("Id", "#SOME-USER-ID#")
.SetTargetingKey("#SOME-USER-ID#")
.Set("Email", "configcat@example.com")
.Set("Country", "CountryID")
.Set("Rating", 4.5)
Expand All @@ -114,5 +121,5 @@ var isAwesomeFeatureEnabled = await client.GetBooleanValueAsync("isAwesomeFeatur

## Look under the hood

- <a href="https://github.com/open-feature/dotnet-sdk-contrib/tree/OpenFeature.Contrib.Providers.ConfigCat-v0.1.1/src/OpenFeature.Contrib.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider's repository on GitHub</a>
- <a href="https://www.nuget.org/packages/OpenFeature.Contrib.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider on nuget.org</a>
- <a href="https://github.com/open-feature/dotnet-sdk-contrib/tree/main/src/OpenFeature.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider's repository on GitHub</a>
- <a href="https://www.nuget.org/packages/OpenFeature.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider on nuget.org</a>
19 changes: 13 additions & 6 deletions website/docs/sdk-reference/openfeature/js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,19 @@ The ConfigCat provider translates these evaluation contexts to ConfigCat [User O

The following table shows how the different context attributes are mapped to User Object attributes.

| Evaluation context | User Object | Required |
| ------------------ | ------------ | -------- |
| `targetingKey` | `identifier` | &#9745; |
| `email` | `email` | |
| `country` | `country` | |
| Any other | `custom` | |
| Evaluation context | User Object | Required |
| ----------------------------- | ------------ | -------- |
| `targetingKey` (`identifier`) | `identifier` | &#9745; |
| `email` | `email` | |
| `country` | `country` | |
| Any other | `custom` | |

Remarks:
- If `targetingKey` is present in the evaluation context, it will be mapped to the `Identifier` property. Otherwise, `identifier` will be mapped.
(If none of these keys are present, the ConfigCat SDK will fall back to using an empty string for the identifier.)
- Predefined keys (i.e., `targetingKey`, `identifier`, `email` and `country`) are matched case-sensitively. (Despite this, never use the keys `Identifier`, `Email` or `Country`, as those are ignored for technical reasons.)
- Predefined keys will also be included in the `custom` object. This allows them to be referenced using their original names in feature flag rules.
- Other keys are mapped as custom user attributes with their values unchanged, except for objects and non-string arrays, which are converted to JSON for historical reasons. (Although the ConfigCat SDK handles value conversion internally, it's recommended to use the type expected by the referencing feature flag rules. Read more [here](../../js/overview#user-object-attribute-types).)

To evaluate feature flags for a context, use the <a href="https://openfeature.dev/docs/reference/concepts/evaluation-api/" target="_blank">OpenFeature Evaluation API</a>:

Expand Down
19 changes: 13 additions & 6 deletions website/docs/sdk-reference/openfeature/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,19 @@ The ConfigCat provider translates these evaluation contexts to ConfigCat [User O

The following table shows how the different context attributes are mapped to User Object attributes.

| Evaluation context | User Object | Required |
| ------------------ | ------------ | -------- |
| `targetingKey` | `identifier` | &#9745; |
| `email` | `email` | |
| `country` | `country` | |
| Any other | `custom` | |
| Evaluation context | User Object | Required |
| ----------------------------- | ------------ | -------- |
| `targetingKey` (`identifier`) | `identifier` | &#9745; |
| `email` | `email` | |
| `country` | `country` | |
| Any other | `custom` | |

Remarks:
- If `targetingKey` is present in the evaluation context, it will be mapped to the `Identifier` property. Otherwise, `identifier` will be mapped.
(If none of these keys are present, the ConfigCat SDK will fall back to using an empty string for the identifier.)
- Predefined keys (i.e., `targetingKey`, `identifier`, `email` and `country`) are matched case-sensitively. (Despite this, never use the keys `Identifier`, `Email` or `Country`, as those are ignored for technical reasons.)
- Predefined keys will also be included in the `custom` object. This allows them to be referenced using their original names in feature flag rules.
- Other keys are mapped as custom user attributes with their values unchanged, except for objects and non-string arrays, which are converted to JSON for historical reasons. (Although the ConfigCat SDK handles value conversion internally, it's recommended to use the type expected by the referencing feature flag rules. Read more [here](../../js/overview#user-object-attribute-types).)

To evaluate feature flags for a context, use the <a href="https://openfeature.dev/docs/reference/concepts/evaluation-api/" target="_blank">OpenFeature Evaluation API</a>:

Expand Down
2 changes: 1 addition & 1 deletion website/docs/sdk-reference/openfeature/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Supported platforms include:
<div className="logo dotnet"></div>
<div className="title-text">.NET</div>
</a>
<a className="action-link" href="https://github.com/open-feature/dotnet-sdk-contrib/tree/OpenFeature.Contrib.Providers.ConfigCat-v0.1.1/src/OpenFeature.Contrib.Providers.ConfigCat" target="_blank"><span className="action-icon github"></span></a>
<a className="action-link" href="https://github.com/open-feature/dotnet-sdk-contrib/tree/main/src/OpenFeature.Providers.ConfigCat" target="_blank"><span className="action-icon github"></span></a>
</div>
<div className="sdk-card">
<a className="title-link" href="/docs/sdk-reference/openfeature/angular">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: ConfigCat OpenFeature Provider for .NET. This is a step-by-step gui
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<a href="https://github.com/open-feature/dotnet-sdk-contrib/tree/OpenFeature.Contrib.Providers.ConfigCat-v0.1.1/src/OpenFeature.Contrib.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider for .NET on GitHub</a>
<a href="https://github.com/open-feature/dotnet-sdk-contrib/tree/main/src/OpenFeature.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider for .NET on GitHub</a>

## Getting started

Expand All @@ -17,21 +17,21 @@ import TabItem from '@theme/TabItem';
<TabItem value="Powershell / NuGet Package Manager Console" label="Powershell / NuGet Package Manager Console">

```powershell
Install-Package OpenFeature.Contrib.Providers.ConfigCat
Install-Package OpenFeature.Providers.ConfigCat
```

</TabItem>
<TabItem value=".NET CLI" label=".NET CLI">

```bash
dotnet add package OpenFeature.Contrib.Providers.ConfigCat
dotnet add package OpenFeature.Providers.ConfigCat
```

</TabItem>
<TabItem value="Package Reference" label="Package Reference">

```xml
<PackageReference Include="OpenFeature.Contrib.Providers.ConfigCat" />
<PackageReference Include="OpenFeature.Providers.ConfigCat" />
```

</TabItem>
Expand All @@ -43,7 +43,7 @@ The `ConfigCatProvider` constructor takes the SDK key and an optional callback t
```cs
using System;
using ConfigCat.Client;
using OpenFeature.Contrib.ConfigCat;
using OpenFeature.Providers.ConfigCat;

// Specify options for the ConfigCat SDK.
Action<ConfigCat.Client.Configuration.ConfigCatClientOptions> configureOptions = (options) =>
Expand Down Expand Up @@ -114,5 +114,5 @@ var isAwesomeFeatureEnabled = await client.GetBooleanValueAsync("isAwesomeFeatur

## Look under the hood

- <a href="https://github.com/open-feature/dotnet-sdk-contrib/tree/OpenFeature.Contrib.Providers.ConfigCat-v0.1.1/src/OpenFeature.Contrib.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider's repository on GitHub</a>
- <a href="https://www.nuget.org/packages/OpenFeature.Contrib.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider on nuget.org</a>
- <a href="https://github.com/open-feature/dotnet-sdk-contrib/tree/main/src/OpenFeature.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider's repository on GitHub</a>
- <a href="https://www.nuget.org/packages/OpenFeature.Providers.ConfigCat" target="_blank">ConfigCat OpenFeature Provider on nuget.org</a>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ConfigCat offers providers for the following platforms supported by OpenFeature
<div className="logo dotnet"></div>
<div className="title-text">.NET</div>
</a>
<a className="action-link" href="https://github.com/open-feature/dotnet-sdk-contrib/tree/OpenFeature.Contrib.Providers.ConfigCat-v0.1.1/src/OpenFeature.Contrib.Providers.ConfigCat" target="_blank"><span className="action-icon github"></span></a>
<a className="action-link" href="https://github.com/open-feature/dotnet-sdk-contrib/tree/main/src/OpenFeature.Providers.ConfigCat" target="_blank"><span className="action-icon github"></span></a>
</div>
<div className="sdk-card">
<a className="title-link" href="/docs/V1/sdk-reference/openfeature/angular">
Expand Down
Loading