Skip to content

Commit de96851

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

File tree

14 files changed

+64
-36
lines changed

14 files changed

+64
-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 Mon Jun 02 2025 17:42:12 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Jun 10 2025 08:11:04 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

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

docs/reference/technologies/client/swift.mdx

Lines changed: 16 additions & 2 deletions
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 Mon Jun 02 2025 17:42:12 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Jun 10 2025 08:11:05 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">
@@ -66,6 +66,20 @@ and in the target dependencies section add:
6666
.product(name: "OpenFeature", package: "swift-sdk"),
6767
```
6868

69+
#### CocoaPods
70+
71+
If you manage dependencies through CocoaPods, add the following to your Podfile:
72+
73+
```ruby
74+
pod 'OpenFeature', '~> 0.3.0'
75+
```
76+
77+
Then, run:
78+
79+
```bash
80+
pod install
81+
```
82+
6983
### Usage
7084

7185
```swift
@@ -188,7 +202,7 @@ A shutdown function is not yet available in the iOS SDK.
188202
### Develop a provider
189203

190204
To develop a provider, you need to create a new project and include the OpenFeature SDK as a dependency.
191-
Youll then need to write the provider by implementing the `FeatureProvider` interface exported by the OpenFeature SDK.
205+
You'll then need to write the provider by implementing the `FeatureProvider` interface exported by the OpenFeature SDK.
192206

193207
```swift
194208
import OpenFeature

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 Mon Jun 02 2025 17:42:12 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Jun 10 2025 08:11:05 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 Mon Jun 02 2025 17:42:11 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Jun 10 2025 08:11:04 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 Mon Jun 02 2025 17:42:11 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Jun 10 2025 08:11:04 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

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

docs/reference/technologies/server/dotnet.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 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 Mon Jun 02 2025 17:42:11 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Jun 10 2025 08:11:04 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
[![Specification](https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge)](https://github.com/open-feature/spec/releases/tag/v0.8.0)

docs/reference/technologies/server/go.mdx

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ 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 Mon Jun 02 2025 17:42:11 GMT+0000 (Coordinated Universal Time)
12+
Last updated at Tue Jun 10 2025 08:11:04 GMT+0000 (Coordinated Universal Time)
1313
-->
1414

1515
<p align="center" class="github-badges">
1616
<a href="https://github.com/open-feature/spec/releases/tag/v0.7.0">
1717
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.7.0&color=yellow&style=for-the-badge" />
1818
</a>
1919

20-
<a href="https://github.com/open-feature/go-sdk/releases/tag/v1.14.1">
21-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.14.1&color=blue&style=for-the-badge" />
20+
<a href="https://github.com/open-feature/go-sdk/releases/tag/v1.15.0">
21+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.15.0&color=blue&style=for-the-badge" />
2222
</a>
2323

2424
<br/>
@@ -69,7 +69,7 @@ func main() {
6969
client := openfeature.NewClient("app")
7070
// Evaluate your feature flag
7171
v2Enabled := client.Boolean(
72-
context.Background(), "v2_enabled", true, openfeature.EvaluationContext{},
72+
context.TODO(), "v2_enabled", true, openfeature.EvaluationContext{},
7373
)
7474
// Use the returned flag value
7575
if v2Enabled {
@@ -166,7 +166,7 @@ client.AddHooks(ExampleClientHook{})
166166

167167
// add a hook for this evaluation only
168168
value, err := client.BooleanValue(
169-
context.Background(), "boolFlag", false, openfeature.EvaluationContext{}, WithHooks(ExampleInvocationHook{}),
169+
context.TODO(), "boolFlag", false, openfeature.EvaluationContext{}, WithHooks(ExampleInvocationHook{}),
170170
)
171171
```
172172

@@ -182,7 +182,7 @@ client := openfeature.NewClient('my-app')
182182

183183
// trigger tracking event action
184184
client.Track(
185-
context.Background(),
185+
context.TODO(),
186186
'visited-promo-page',
187187
openfeature.EvaluationContext{},
188188
openfeature.NewTrackingEventDetails(99.77).Add("currencyCode", "USD"),
@@ -203,29 +203,43 @@ This hook can be particularly helpful for troubleshooting and debugging; simply
203203
##### Usage example
204204

205205
```go
206-
// configure slog
207-
var programLevel = new(slog.LevelVar)
208-
programLevel.Set(slog.LevelDebug)
209-
h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel})
210-
slog.SetDefault(slog.New(h))
211-
212-
// add a hook globally to run on all evaluations
213-
hook, err := NewLoggingHook(false)
214-
if err != nil {
215-
// handle error
216-
}
206+
package main
207+
208+
import (
209+
"context"
210+
"log/slog"
211+
"os"
212+
213+
"github.com/open-feature/go-sdk/openfeature"
214+
"github.com/open-feature/go-sdk/openfeature/hooks"
215+
"github.com/open-feature/go-sdk/openfeature/memprovider"
216+
)
217+
218+
func main() {
219+
// Register an in-memory provider with no flags
220+
openfeature.SetNamedProviderAndWait("example", memprovider.NewInMemoryProvider(map[string]memprovider.InMemoryFlag{}))
217221

218-
openfeature.AddHooks(hook)
222+
// Configure slog
223+
handler := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelDebug})
224+
logger := slog.New(handler)
219225

220-
client.BooleanValueDetails(context.Background(), "not-exist", true, openfeature.EvaluationContext{})
226+
// Register a logging hook globally to run on all evaluations
227+
loggingHook := hooks.NewLoggingHook(false, logger)
228+
openfeature.AddHooks(loggingHook)
221229

230+
// Create a new client
231+
client := openfeature.NewClient("example")
232+
233+
// Attempt to evaluate a flag that doesn't exist
234+
_ = client.Boolean(context.TODO(), "not-exist", true, openfeature.EvaluationContext{})
235+
}
222236
```
223237

224238
###### Output
225239

226240
```sh
227-
{"time":"2024-10-23T13:33:09.8870867+03:00","level":"DEBUG","msg":"Before stage","domain":"test-client","provider_name":"InMemoryProvider","flag_key":"not-exist","default_value":true}
228-
{"time":"2024-10-23T13:33:09.8968242+03:00","level":"ERROR","msg":"Error stage","domain":"test-client","provider_name":"InMemoryProvider","flag_key":"not-exist","default_value":true,"error_message":"error code: FLAG_NOT_FOUND: flag for key not-exist not found"}
241+
{"time":"2025-06-03T10:49:23.100783-04:00","level":"DEBUG","msg":"Before stage","domain":"example","provider_name":"InMemoryProvider","flag_key":"not-exist","default_value":true,"stage":"before"}
242+
{"time":"2025-06-03T10:49:23.101037-04:00","level":"ERROR","msg":"Error stage","domain":"example","provider_name":"InMemoryProvider","flag_key":"not-exist","default_value":true,"error_message":"error code: FLAG_NOT_FOUND: flag for key not-exist not found","stage":"error"}
229243
```
230244

231245
See [hooks](#hooks) for more information on configuring hooks.
@@ -299,7 +313,7 @@ Transaction context can be set where specific data is available (e.g. an auth se
299313
import "github.com/open-feature/go-sdk/openfeature"
300314

301315
// set the TransactionContext
302-
ctx := openfeature.WithTransactionContext(context.Background(), openfeature.EvaluationContext{})
316+
ctx := openfeature.WithTransactionContext(context.TODO(), openfeature.EvaluationContext{})
303317

304318
// get the TransactionContext from a context
305319
ec := openfeature.TransactionContext(ctx)

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 Mon Jun 02 2025 17:42:10 GMT+0000 (Coordinated Universal Time)
12+
Last updated at Tue Jun 10 2025 08:11:03 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 Mon Jun 02 2025 17:42:10 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Jun 10 2025 08:11:03 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 Mon Jun 02 2025 17:42:10 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Jun 10 2025 08:11:04 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

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

0 commit comments

Comments
 (0)