Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: mention streaming in client sdk docs #284

Merged
merged 1 commit into from
Oct 24, 2024
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
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 @@

- **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 @@
> 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 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
Loading