Skip to content

Commit 7cf66df

Browse files
chore: update sdk readmes
Signed-off-by: OpenFeature Bot <[email protected]>
1 parent ff21506 commit 7cf66df

File tree

13 files changed

+54
-36
lines changed

13 files changed

+54
-36
lines changed

docs/reference/technologies/client/kotlin.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from kotlin-sdk.
1010
Edits should be made here: https://github.com/open-feature/kotlin-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jan 22 2025 08:09:31 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Thu Jan 30 2025 08:09:20 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/client/swift.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from swift-sdk.
1010
Edits should be made here: https://github.com/open-feature/swift-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jan 22 2025 08:09:31 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Thu Jan 30 2025 08:09:20 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/client/web/angular.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jan 22 2025 08:09:32 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Thu Jan 30 2025 08:09:21 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/client/web/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jan 22 2025 08:09:31 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Thu Jan 30 2025 08:09:19 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/client/web/react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jan 22 2025 08:09:31 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Thu Jan 30 2025 08:09:19 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/server/dotnet.mdx

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from dotnet-sdk.
1010
Edits should be made here: https://github.com/open-feature/dotnet-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jan 22 2025 08:09:30 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Thu Jan 30 2025 08:09:18 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
[![Specification](https://img.shields.io/static/v1?label=specification&message=v0.7.0&color=yellow&style=for-the-badge)](https://github.com/open-feature/spec/releases/tag/v0.7.0)
@@ -154,6 +154,19 @@ var value = await client.GetBooleanValueAsync("boolFlag", false, context, new Fl
154154

155155
The .NET SDK uses Microsoft.Extensions.Logging. See the [manual](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line) for complete documentation.
156156

157+
#### Logging Hook
158+
159+
The .NET SDK includes a LoggingHook, which logs detailed information at key points during flag evaluation, using Microsoft.Extensions.Logging structured logging API. This hook can be particularly helpful for troubleshooting and debugging; simply attach it at the global, client or invocation level and ensure your log level is set to "debug".
160+
161+
```csharp
162+
using var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
163+
var logger = loggerFactory.CreateLogger("Program");
164+
165+
var client = Api.Instance.GetClient();
166+
client.AddHooks(new LoggingHook(logger));
167+
```
168+
See [hooks](#hooks) for more information on configuring hooks.
169+
157170
### Domains
158171

159172
Clients can be assigned to a domain.
@@ -380,37 +393,42 @@ builder.Services.AddOpenFeature(featureBuilder => {
380393
You can register a custom provider, such as `InMemoryProvider`, with OpenFeature using the `AddProvider` method. This approach allows you to dynamically resolve services or configurations during registration.
381394

382395
```csharp
383-
services.AddOpenFeature()
384-
.AddProvider(provider =>
396+
services.AddOpenFeature(builder =>
397+
{
398+
builder.AddProvider(provider =>
399+
{
400+
// Resolve services or configurations as needed
401+
var variants = new Dictionary<string, bool> { { "on", true } };
402+
var flags = new Dictionary<string, Flag>
385403
{
386-
// Resolve services or configurations as needed
387-
var configuration = provider.GetRequiredService<IConfiguration>();
388-
var flags = new Dictionary<string, Flag>
389-
{
390-
{ "feature-key", new Flag<bool>(configuration.GetValue<bool>("FeatureFlags:Key")) }
391-
};
392-
393-
// Register a custom provider, such as InMemoryProvider
394-
return new InMemoryProvider(flags);
395-
});
404+
{ "feature-key", new Flag<bool>(variants, "on") }
405+
};
406+
407+
// Register a custom provider, such as InMemoryProvider
408+
return new InMemoryProvider(flags);
409+
});
410+
});
396411
```
397412

398413
#### Adding a Domain-Scoped Provider
399414

400415
You can also register a domain-scoped custom provider, enabling configurations specific to each domain:
401416

402417
```csharp
403-
services.AddOpenFeature()
404-
.AddProvider("my-domain", (provider, domain) =>
418+
services.AddOpenFeature(builder =>
419+
{
420+
builder.AddProvider("my-domain", (provider, domain) =>
421+
{
422+
// Resolve services or configurations as needed for the domain
423+
var variants = new Dictionary<string, bool> { { "on", true } };
424+
var flags = new Dictionary<string, Flag>
405425
{
406-
// Resolve services or configurations as needed for the domain
407-
var flags = new Dictionary<string, Flag>
408-
{
409-
{ $"{domain}-feature-key", new Flag<bool>(true) }
410-
};
411-
412-
// Register a domain-scoped custom provider such as InMemoryProvider
413-
return new InMemoryProvider(flags);
414-
});
426+
{ $"{domain}-feature-key", new Flag<bool>(variants, "on") }
427+
};
428+
429+
// Register a domain-scoped custom provider such as InMemoryProvider
430+
return new InMemoryProvider(flags);
431+
});
432+
});
415433
```
416434

docs/reference/technologies/server/go.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This content has been automatically generated from go-sdk.
99
Edits should be made here: https://github.com/open-feature/go-sdk
1010
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1111

12-
Last updated at Wed Jan 22 2025 08:09:30 GMT+0000 (Coordinated Universal Time)
12+
Last updated at Thu Jan 30 2025 08:09:18 GMT+0000 (Coordinated Universal Time)
1313
-->
1414

1515
<p align="center" class="github-badges">

docs/reference/technologies/server/java.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This content has been automatically generated from java-sdk.
99
Edits should be made here: https://github.com/open-feature/java-sdk
1010
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1111

12-
Last updated at Wed Jan 22 2025 08:09:29 GMT+0000 (Coordinated Universal Time)
12+
Last updated at Thu Jan 30 2025 08:09:17 GMT+0000 (Coordinated Universal Time)
1313
-->
1414

1515
<p align="center" class="github-badges">

docs/reference/technologies/server/javascript/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jan 22 2025 08:09:30 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Thu Jan 30 2025 08:09:17 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/server/javascript/nestjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jan 22 2025 08:09:30 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Thu Jan 30 2025 08:09:17 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

0 commit comments

Comments
 (0)