Skip to content

Commit

Permalink
chore: mention streaming in client sdk docs
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Phelps <[email protected]>
  • Loading branch information
markphelps committed Oct 24, 2024
1 parent 33feddc commit eb8a845
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cloud/guides/production.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,16 @@ Currently, Flipt Cloud only support client-side SDKs for direct evaluation via t
- `URL`: The URL of the Flipt Cloud API.
- `Authentication`: The API key authentication method configured with the API key you created in the previous step.
- (Optional) `Namespace`: The namespace to use for the SDK. (Default: `default`)
- (Optional) `Fetch Mode`: Set to `streaming` to enable streaming mode. (Default: `polling`)

For example, here's how you can configure the SDK for a Go application:

```go
evaluationClient, _ := flipt.NewClient(
flipt.WithURL("https://<environment>-<organization>.flipt.cloud"),
flipt.WithClientTokenAuthentication(<api-key>),
flipt.WithNamespace(<namespace>)
flipt.WithNamespace(<namespace>),
flipt.WithFetchMode(flipt.FetchModeStreaming),
)
```

Expand Down
2 changes: 2 additions & 0 deletions cloud/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ description: Our Cloud offering is the simplest, scalable solution for getting s

- **GitOps and ClickOps Friendly**: Store your feature flag configurations in your own Git repository, giving you full control over your data while benefiting from familiar Git workflows. Non-technical team members can still easily manage flags through our user-friendly interface.

- **Real-Time Updates**: With Flipt Cloud, you can enable streaming mode, which will make the SDK subscribe to changes on the Flipt server and update the state of the flags accordingly in real-time.

Check warning on line 29 in cloud/overview.mdx

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [Openly.FutureTense] Possible future tense. Raw Output: {"message": "[Openly.FutureTense] Possible future tense.", "location": {"path": "cloud/overview.mdx", "range": {"start": {"line": 29, "column": 81}}}, "severity": "WARNING"}

- **Zero Lock-In**: With your feature flag data stored in a standard YAML format, you're never locked into our platform. Easily export or migrate your data at any time, ensuring flexibility as your needs evolve.

- **Scalable and Enterprise-Ready**: Our cloud infrastructure is designed to handle high-volume traffic and complex flag evaluations, making it suitable for organizations of all sizes, from startups to global enterprises.
Expand Down
13 changes: 13 additions & 0 deletions integration/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,16 @@ Flipt provides a number of client-side SDKs to help you integrate with Flipt in
> Need a client in another language? Let us know!
</Card>
</CardGroup>
## Polling vs Streaming

By default, the SDKs will use a polling mechanism to sync the state of the flags with the Flipt server. You can set the polling interval using the `updateInterval` option in the SDK's configuration.

Check warning on line 94 in integration/client.mdx

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [Openly.FutureTense] Possible future tense. Raw Output: {"message": "[Openly.FutureTense] Possible future tense.", "location": {"path": "integration/client.mdx", "range": {"start": {"line": 94, "column": 22}}}, "severity": "WARNING"}

Check failure on line 94 in integration/client.mdx

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [Flipt.Spelling] Check the spelling of 'SDK's'. If the spelling is correct, add this word to the spelling exception list. Raw Output: {"message": "[Flipt.Spelling] Check the spelling of 'SDK's'. If the spelling is correct, add this word to the spelling exception list.", "location": {"path": "integration/client.mdx", "range": {"start": {"line": 94, "column": 179}}}, "severity": "ERROR"}

If you are a [Flipt Cloud](/cloud/overview) user, you can enable `streaming` mode, which will make the SDK subscribe to changes on the Flipt server and update the state of the flags accordingly in real-time.

Check warning on line 96 in integration/client.mdx

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [Openly.SentenceLength] Write short sentences (less than 25 words). Raw Output: {"message": "[Openly.SentenceLength] Write short sentences (less than 25 words).", "location": {"path": "integration/client.mdx", "range": {"start": {"line": 96, "column": 1}}}, "severity": "WARNING"}

Check warning on line 96 in integration/client.mdx

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [Openly.FutureTense] Possible future tense. Raw Output: {"message": "[Openly.FutureTense] Possible future tense.", "location": {"path": "integration/client.mdx", "range": {"start": {"line": 96, "column": 90}}}, "severity": "WARNING"}

<Card href="/cloud/overview" title="Flipt Cloud" icon="cloud">
Flipt Cloud is a fully managed feature management platform that enables you to
continue to use Flipt's feature management capabilities with zero maintenance.
</Card>

Streaming is available for all Flipt Cloud plans, even the free tier.
6 changes: 6 additions & 0 deletions integration/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ Client-side evaluation is another way Flipt supports evaluating feature flags. T

Client-side evaluation is much more performant than server-side evaluation, but it comes with some tradeoffs. The main tradeoff is that you need to keep your feature flag rules in sync with Flipt. This means that you will need to periodically fetch the feature flag rules from Flipt and update your local copy. Our client-side SDKs provide a way to do this automatically.

<Tip>
If you are a [Flipt Cloud](/cloud/overview) user, you can enable streaming

Check warning on line 57 in integration/overview.mdx

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [Openly.SentenceLength] Write short sentences (less than 25 words). Raw Output: {"message": "[Openly.SentenceLength] Write short sentences (less than 25 words).", "location": {"path": "integration/overview.mdx", "range": {"start": {"line": 57, "column": 3}}}, "severity": "WARNING"}
mode, which will make the SDK subscribe to changes on the Flipt server and

Check warning on line 58 in integration/overview.mdx

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [Openly.FutureTense] Possible future tense. Raw Output: {"message": "[Openly.FutureTense] Possible future tense.", "location": {"path": "integration/overview.mdx", "range": {"start": {"line": 58, "column": 15}}}, "severity": "WARNING"}
update the state of the flags accordingly in real-time.
</Tip>

Reasons for using client-side evaluation include:

- You want to reduce the number of requests your application makes to Flipt for feature flag evaluations
Expand Down

0 comments on commit eb8a845

Please sign in to comment.