Skip to content

Commit e63662f

Browse files
docs: recommendations against standalone SDK usage (#291)
1 parent ef92a61 commit e63662f

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,10 @@ OpenFeature.setContext({
8383

8484
try {
8585
await OpenFeature.setProviderAndWait(provider);
86-
} (error) {
86+
} catch (error) {
8787
console.error('Failed to initialize Confidence provider:', error);
8888
}
8989

90-
9190
const client = OpenFeature.getClient();
9291
const isEnabled = client.getBooleanValue('feature.enabled', false);
9392
```
@@ -108,12 +107,18 @@ You can check out the example application, which is built with Next.js and uses
108107

109108
# Direct SDK Usage
110109

110+
> [!NOTE]
111+
> The standalone SDK is being phased out. For new integrations, we recommend using the OpenFeature APIs described above.
112+
111113
The vanilla sdk can be used in cases where you want direct access to the Confidence SDK, including event tracking and custom context management.
112114

113115
> **Learn more**: [SDK Documentation](./packages/sdk/README.md)
114116
115117
## React Integration
116118

119+
> [!NOTE]
120+
> The standalone React SDK is being phased out. For new integrations, see the [OpenFeature React SDK](https://openfeature.dev/docs/reference/sdks/client/web/react/) section above, or consider server-side flag resolution for SSR applications.
121+
117122
For React applications, use the dedicated React package that provides hooks and providers for seamless integration. This package is built on top of the direct SDK usage.
118123

119124
> **Learn more**: [React Integration Documentation](./packages/react/README.md)

packages/react/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
![](https://img.shields.io/badge/lifecycle-beta-a0c3d2.svg)
44

5+
> [!NOTE]
6+
> This Confidence standalone React SDK is being phased out. For new integrations, we recommend using the OpenFeature APIs directly:
7+
>
8+
> - **Client SPA**: Use the [OpenFeature React SDK](https://openfeature.dev/docs/reference/sdks/client/web/react/) with our [@spotify-confidence/openfeature-web-provider](https://github.com/spotify/confidence-sdk-js/blob/main/packages/openfeature-web-provider/README.md)
9+
> - **SSR (e.g., Next.js)**: Resolve all flags server-side using [@spotify-confidence/openfeature-server-provider-local](https://github.com/spotify/confidence-resolver/tree/main/openfeature-provider/js/README.md) and propagate values to the client. This gives optimal performance, avoids the complexity of managing context across the client/server boundary, and keeps flag logic and sensitive context data securely private.
10+
511
This package contains helper functionality to make the Confidence SDK work well in a React environment. **Note:** This package is only relevant if you are using the Confidence SDK directly. If you are using OpenFeature, please use the [OpenFeature React SDK](https://github.com/open-feature/js-sdk/tree/main/packages/react-sdk) instead.
612

713
# Usage

packages/sdk/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
![](https://img.shields.io/badge/lifecycle-beta-a0c3d2.svg)
44

5+
> [!NOTE]
6+
> This Confidence standalone SDK is being phased out. For new integrations, we recommend using the OpenFeature APIs directly:
7+
>
8+
> - **Client-based (SPA)**: Use [@spotify-confidence/openfeature-web-provider](https://github.com/spotify/confidence-sdk-js/blob/main/packages/openfeature-web-provider/README.md)
9+
> - **Server**: Use [@spotify-confidence/openfeature-server-provider-local](https://github.com/spotify/confidence-resolver/tree/main/openfeature-provider/js/README.md), which resolves flags in-process with close to zero latency
10+
511
JavaScript implementation of the Confidence SDK, enables event tracking and feature flagging capabilities in conjunction with the OpenFeature Web SDK.
612

713
# Usage

0 commit comments

Comments
 (0)