-
Notifications
You must be signed in to change notification settings - Fork 3
Configuration
Ahmed Abbas edited this page Apr 7, 2026
·
1 revision
The full SDK configuration options object with all available fields.
import {LogLevel} from '@convertcom/js-sdk';
const config = {
sdkKey: '', // either this or 'data' is required
sdkKeySecret: '', // required when using an authenticated SDK key
environment: 'staging',
logger: {
logLevel: LogLevel.DEBUG,
customLoggers: [] // allows 3rd party loggers
},
bucketing: {
hash_seed: 9999, // MurmurHash seed
max_traffic: 10000, // max hash value (100% traffic)
excludeExperienceIdHash: false // whether to ignore prefixing hash with experience id
},
dataStore: null, // optional persistent DataStore (see Persistent DataStore below)
dataRefreshInterval: 300000, // config refresh interval in ms (5 minutes)
data: projectData, // static project configuration (alternative to sdkKey)
events: {
batch_size: 10, // max events per network batch
release_interval: 10000 // time in ms between queue releases
},
network: {
tracking: true, // set false to disable tracking events
cacheLevel: 'default', // 'low' for short-lived cache (dev only)
source: 'js-sdk' // source identifier in network requests
}
};| Field | Type | Required | Default | Description |
|---|---|---|---|---|
sdkKey |
string | Yes (or data) |
— | Project identifier. The SDK fetches configuration from Convert's CDN using this key. |
sdkKeySecret |
string | No | — | Required when using an authenticated SDK key. |
environment |
string | No | — | Environment to match rules against ('staging' or 'production'). |
data |
object | Yes (or sdkKey) |
— | Static project configuration object (alternative to sdkKey). |
dataStore |
object | null | No | null |
Persistent DataStore for bucketing decisions across sessions. Must implement get(key) and set(key, value). |
dataRefreshInterval |
number | No | 300000 |
How often (in ms) to refresh configuration from the CDN. |
| Field | Type | Default | Description |
|---|---|---|---|
logLevel |
LogLevel | LogLevel.WARN |
Minimum log level: DEBUG, INFO, WARN, ERROR, SILENT. |
customLoggers |
array | [] |
Array of third-party logger instances. |
| Field | Type | Default | Description |
|---|---|---|---|
hash_seed |
number | 9999 |
Seed value for the MurmurHash algorithm. |
max_traffic |
number | 10000 |
Maximum hash value representing 100% traffic allocation. |
excludeExperienceIdHash |
boolean | false |
Whether to ignore prefixing the generated hash with the experience ID. |
| Field | Type | Default | Description |
|---|---|---|---|
batch_size |
number | 10 |
Maximum number of network requests released per batch. |
release_interval |
number | 10000 |
Time in milliseconds between queue releases. |
| Field | Type | Default | Description |
|---|---|---|---|
tracking |
boolean | true |
Set to false to disable sending tracking events to Convert. |
cacheLevel |
string | 'default' |
Set to 'low' for short-lived cache (development only). |
source |
string | 'js-sdk' |
Source identifier included in network requests. |
The data / projectData structure is documented in the Data Model and at the Convert Serving API docs.
- Initialization -- how to use these config options when starting the SDK
- Code Examples -- complete examples for every SDK method
Copyrights © 2025 All Rights Reserved by Convert Insights, Inc.
Getting Started
JavaScript SDK
Core Concepts
- Experiences & Variations
- Feature Flags
- Bucketing Algorithm
- Rule Evaluation
- Segments
- Data Management
- Event System
- API Communication
How-To Guides
- Running Experiences
- Running Features
- Tracking Conversions
- Visitor Context
- Persistent DataStore
- Client-Side Experimentation
- Server-Side Experimentation
- Tracking Script → SDK
- Troubleshooting
Edge & Integrations
Contributing