Skip to content
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
19 changes: 18 additions & 1 deletion docs/sdk/client-side-sdks/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ const dvcOptions = { logLevel: 'debug' }
const dvcClient = initialize('YOUR_CLIENT_KEY', user, dvcOptions)
```

### DVC User Object

[DVCUser Typescript Schema](https://github.com/DevCycleHQ/js-sdks/blob/main/sdk/js/src/types.ts#L55)

| Property | Type | Description |
|------------|------|-------------|
| isAnonymous | boolean | Boolean to indicate if the user is anonymous |
| user_id | string | Unique user ID |
| email | string | User's email |
| name | string | User's name |
| language | string | User's language |
| country | string | User's country |
| appVersion | string | App version |
| appBuild | number | App build |
| customData | DVCJSON | Key/value map of properties to be used for targeting |
| privateCustomData | DVCJSON | Key/value map of properties to be used for targeting. Private properties will not be included in event logging. |

### Initialization Options

The SDK exposes various initialization options which can be set on the `initialization()` method:
Expand All @@ -47,7 +64,7 @@ The SDK exposes various initialization options which can be set on the `initiali

| DVC Option | Type | Description |
|------------|------|-------------|
| eventFlushIntervalMS | number | 10000 | Controls the interval between flushing events to the DevCycle servers in milliseconds, defaults to 10 seconds. |
| eventFlushIntervalMS | number | Controls the interval between flushing events to the DevCycle servers in milliseconds, defaults to 10 seconds. |
| 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`. |
Expand Down
26 changes: 26 additions & 0 deletions docs/sdk/client-side-sdks/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,32 @@ import { asyncWithDVCProvider } from '@devcycle/devcycle-react-sdk'

## Usage

### Provider Config

The `withDVCProvider` function accepts a Provider Config object:

[DVC ProviderConfig Typescript Schema](https://github.com/DevCycleHQ/js-sdks/blob/main/sdk/react/src/types.ts#L3)

| Property | Type | Description |
|------------|------|-------------|
| envKey | string | Environment key |
| user | [DVCUser](https://github.com/DevCycleHQ/js-sdks/blob/main/sdk/js/src/types.ts#L55) | DevCycle user object |
| options | [DVCOptions](https://github.com/DevCycleHQ/js-sdks/blob/main/sdk/js/src/types.ts#L44) | DevCycle options object |

### Initialization Options

The SDK exposes various initialization options which can be set by passing a `DVCOptions` object in the Provider Config:

[DVCOptions Typescript Schema](https://github.com/DevCycleHQ/js-sdks/blob/main/sdk/js/src/types.ts#L44)

| DVC Option | Type | Description |
|------------|------|-------------|
| eventFlushIntervalMS | number | Controls the interval between flushing events to the DevCycle servers in milliseconds, defaults to 10 seconds. |
| 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`. |
| apiProxyURL | string | Allows the SDK to communicate with a proxy of DVC bucketing API / client SDK API.

### Getting a Variable

The SDK provides a hook to access your DevCycle variables:
Expand Down