diff --git a/docs/sdk/client-side-sdks/angular/angular-usage.md b/docs/sdk/client-side-sdks/angular/angular-usage.md index a54fb00a..88932417 100644 --- a/docs/sdk/client-side-sdks/angular/angular-usage.md +++ b/docs/sdk/client-side-sdks/angular/angular-usage.md @@ -13,14 +13,14 @@ sidebar_custom_props: { icon: material-symbols:toggle-on } As this is a DevCycle OpenFeature Provider, using the [Angular OpenFeature SDK](https://openfeature.dev/docs/reference/technologies/client/web/angular#how-to-use), you need to use the OpenFeature APIs to get the value of a variable. -If you need access to the DevCycle Client for access to the methods like `track` / `allFeatures` / `allVariables`, you can use the `devcycleClient()` method on the `DevCycleAngularProvider` object: +If you need access to the DevCycle Client for access to the methods like `track` / `allFeatures` / `allVariables`, you can use the `devcycleClient` property on the `DevCycleAngularProvider` object: ```typescript const devCycleProvider = new DevCycleAngularProvider( environment.DEVCYCLE_CLIENT_SDK_KEY, { /* DevCycle Options */ } ); -const devcycleClient = devCycleProvider.devcycleClient(); +const devcycleClient = devCycleProvider.devcycleClient; const features = devcycleClient.allFeatures() const variables = devcycleClient.allVariables() ``` @@ -134,4 +134,3 @@ However, these are not valid types for the DevCycle SDK, the DevCycle SDK only s // Valid JSON Object as the default value, will be evaluated by the DevCycle SDK openFeatureClient.getObjectValue('json-flag', { default: 'value' }) ``` - diff --git a/docs/sdk/client-side-sdks/javascript/javascript-gettingstarted.md b/docs/sdk/client-side-sdks/javascript/javascript-gettingstarted.md index b40db478..be51bdf2 100644 --- a/docs/sdk/client-side-sdks/javascript/javascript-gettingstarted.md +++ b/docs/sdk/client-side-sdks/javascript/javascript-gettingstarted.md @@ -14,9 +14,9 @@ sidebar_custom_props: { icon: material-symbols:rocket } - If the JS SDK is installed using NPM, call `initializeDevCycle` with your client key, a user object, and an optional options object. - Otherwise, If you're using the CDN to install the JS SDK, call `DevCycle.initializeDevCycle` with your client key, a user object, and an optional options object. -The user object needs either a `user_id`, or `isAnonymous` set to `true` for an anonymous user. The options object is optional, -but can passed a `logWriter` for a custom logging solution and a `logLevel`, which must be one of `info`, `debug`, `warn` or `error`. -The default options are to set the `logWriter` to be the console and the `logLevel` to `error`. +The user object needs either a `user_id`, or `isAnonymous` set to `true` for an anonymous user. The options object is optional. +It accepts a `logger` implementation for custom logging and a `logLevel`, which must be one of `info`, `debug`, `warn` or `error`. +The default logger writes to the console and the default `logLevel` is `error`. ```javascript const user = { user_id: 'my_user' } @@ -39,7 +39,7 @@ downloaded from DevCycle. The SDK makes a call to get the configuration for anon If you would like to defer initialization of the SDK until your user data is available, you can pass the `deferInitialization` option to the `initializeDevCycle` method. This will cause the SDK to not fetch a configuration until the -[`devcycleClient.identifyUser`](/sdk/client-side-sdks/javascript/javascript-usage#identifying-user) method is called with the user data. +[`devcycleClient.identifyUser`](/sdk/client-side-sdks/javascript/javascript-usage#identifying-users) method is called with the user data. Until that config is retrieved, all calls to retrieve variable values will return their default values. @@ -82,10 +82,11 @@ The SDK exposes various initialization options which can be set on the `initiali | ---------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | enableEdgeDB | Boolean | Enables the usage of EdgeDB for DevCycle that syncs User Data to DevCycle. | | logger | [DVCLogger](https://github.com/DevCycleHQ/js-sdks/blob/main/lib/shared/types/src/logger.ts#L2) | Logger override to replace default logger | -| logLevel | [DVCDefaultLogLevel](https://github.com/DevCycleHQ/js-sdks/blob/main/lib/shared/types/src/logger.ts#L12) | Set log level of the default logger. Options are: `debug`, `info`, `warn`, `error`. Defaults to `info`. | +| logLevel | [DVCDefaultLogLevel](https://github.com/DevCycleHQ/js-sdks/blob/main/lib/shared/types/src/logger.ts#L12) | Set log level of the default logger. Options are: `debug`, `info`, `warn`, `error`. Defaults to `error`. | | eventFlushIntervalMS | Number | Controls the interval between flushing events to the DevCycle servers in milliseconds, defaults to 10 seconds. | | flushEventQueueSize | Number | Controls the maximum size the event queue can grow to until a flush is forced. Defaults to `100`. | | maxEventQueueSize | Number | Controls the maximum size the event queue can grow to until events are dropped. Defaults to `1000`. | +| bootstrapConfig | BucketedUserConfig | Bootstraps the SDK with configuration fetched by a server-side renderer, avoiding an initial config request. | | apiProxyURL | String | Allows the SDK to communicate with a proxy of DevCycle bucketing API / client SDK API. | | configCacheTTL | Number | The maximum allowed age of a cached config in milliseconds, defaults to 30 days | | disableConfigCache | Boolean | Disable the use of cached configs | diff --git a/docs/sdk/client-side-sdks/javascript/javascript-usage.md b/docs/sdk/client-side-sdks/javascript/javascript-usage.md index d12fe28c..84c00054 100644 --- a/docs/sdk/client-side-sdks/javascript/javascript-usage.md +++ b/docs/sdk/client-side-sdks/javascript/javascript-usage.md @@ -83,7 +83,7 @@ variable.onUpdate((value) => { }) ``` -## Identifying User +## Identifying Users To identify a different user, or the same user passed into the initialize function with more attributes, pass in the entire user attribute object into `identifyUser`: diff --git a/docs/sdk/client-side-sdks/nextjs/nextjs-usage-app.md b/docs/sdk/client-side-sdks/nextjs/nextjs-usage-app.md index 97d2badd..54684344 100644 --- a/docs/sdk/client-side-sdks/nextjs/nextjs-usage-app.md +++ b/docs/sdk/client-side-sdks/nextjs/nextjs-usage-app.md @@ -34,7 +34,7 @@ const getUserIdentity = async () => { } } -export const { getVariableValue, getClientContext } = setupDevCycle({ +export const { getVariableValue, getClientContext, track } = setupDevCycle({ // Server SDK Key. This will be private and used to retrieve configuration data, so you MUST use the server SDK key. serverSDKKey: process.env.DEVCYCLE_SERVER_SDK_KEY ?? '', // Client SDK Key. This will be public and sent to the client, so you MUST use the client SDK key. @@ -85,8 +85,8 @@ It will also await the retrieval of the DevCycle configuration, thus blocking fu have been retrieved and rendering can take place with the correct values. :::caution -Due to a bug in Next.js, realtime updates functionality is only available in Next.js 14.1 and above. If using a version -below that, you _must_ disable realtime updates to prevent clientside errors. To do so, pass the option in your +Realtime updates require a supported Next.js version. The current SDK package requires Next.js 15.1.9 or later. If using an +older SDK release with an older Next.js version, disable realtime updates to prevent client-side errors. To do so, pass the option in your initialization function: ```typescript diff --git a/docs/sdk/client-side-sdks/react-native/react-native-expo-install.md b/docs/sdk/client-side-sdks/react-native/react-native-expo-install.md index c1e501df..0c4da983 100644 --- a/docs/sdk/client-side-sdks/react-native/react-native-expo-install.md +++ b/docs/sdk/client-side-sdks/react-native/react-native-expo-install.md @@ -38,13 +38,13 @@ Install the SDK dependencies, run the following command ### npx ```bash -npx expo install @react-native-async-storage/async-storage react-native-get-random-values react-native-device-info react-native-sse +npx expo install @react-native-async-storage/async-storage react-native-get-random-values react-native-device-info ``` ### yarn ```bash -yarn expo install @react-native-async-storage/async-storage react-native-get-random-values react-native-device-info react-native-sse +yarn expo install @react-native-async-storage/async-storage react-native-get-random-values react-native-device-info ``` ## Install Pods @@ -58,7 +58,7 @@ npx pod-install The [@react-native-async-storage/async-storage](https://www.npmjs.com/package/@react-native-async-storage/async-storage) package provides the ability to leverage on Device Storage that is used for caching by the SDK. The [react-native-get-random-values](https://www.npmjs.com/package/react-native-get-random-values) package provides a polyfill for cryptographic functionality used to generate random IDs. The [react-native-device-info](https://www.npmjs.com/package/react-native-device-info) package provides information about the current device running the SDK, which is required to correctly apply targeting rules. -The [react-native-sse](https://www.npmjs.com/package/react-native-sse) package provides SSE connection functionality to enable real-time updates. +The bare React Native SDK uses `react-native-sse` for realtime updates. The Expo package supplies its own Expo-compatible configuration and does not list `react-native-sse` as a package dependency. [//]: # 'wizard-initialize-start' diff --git a/docs/sdk/client-side-sdks/react-native/react-native-usage.md b/docs/sdk/client-side-sdks/react-native/react-native-usage.md index 2fceab3d..494c97bd 100644 --- a/docs/sdk/client-side-sdks/react-native/react-native-usage.md +++ b/docs/sdk/client-side-sdks/react-native/react-native-usage.md @@ -25,16 +25,15 @@ The hook will return the default value if the SDK has not yet finished initializ ```js import { useVariableValue } from '@devcycle/react-native-client-sdk' +import { Text } from 'react-native' const DevCycleFeaturePage = () => { const variableKey = 'my-feature' - const defaultValue = 'false' + const defaultValue = false const featureVariable = useVariableValue(variableKey, defaultValue) return ( -