Complete reference for RevTurbineInitOptions and related configuration types.
| Field | Type | Description |
|---|
tenantId | string | Your RevTurbine tenant identifier |
apiKey | string | API key (rt_live_*, rt_test_*, or 'local' for local mode) |
endpoint | string | RevTurbine API endpoint URL |
mode | 'react' | 'snippet' | 'iframe' | SDK integration mode |
| Field | Type | Default | Description |
|---|
runtimeMode | 'revturbine_server' | 'custom_endpoints' | 'local_only' | 'revturbine_server' | How the SDK resolves decisions |
endpointOverrides | Partial<RevTurbineEndpointOverrides> | — | Custom endpoint URLs (for custom_endpoints mode) |
configProvider | RevTurbineConfigProvider | — | Custom provider for ExportedConfig |
localRuntime | RevTurbineLocalRuntimeOptions | — | Local-only mode configuration |
| Field | Type | Default | Description |
|---|
provider | RevTurbineSdkProvider | RevTurbineProviderFactory | — | Primary provider override |
providerFallbacks | Array<...> | — | Fallback provider chain |
domainProviders | AnyDomainProvider[] | — | Domain-specific providers |
providerFailureSlotBehavior | 'placeholder' | 'invisible' | 'invisible' | Slot behavior after provider failure |
| Field | Type | Default | Description |
|---|
uiPathResolvers | RevTurbineUiPathResolverMap | — | Map of CTA action types to resolver functions |
| Field | Type | Default | Description |
|---|
user | RevTurbineUserContext | — | Initial user context |
page | RevTurbinePageContext | — | Page context (URL, title, referrer, tags) |
contextPolicy | RevTurbineContextPolicy | { inferUser: true, inferPage: true, routerAutoTrack: true } | Auto-inference behavior |
| Field | Type | Default | Description |
|---|
placementBehavior | Partial<RevTurbinePlacementBehaviorFlags> | — | Opt-in pipeline flags |
| Field | Type | Default | Description |
|---|
persistentStorage | RevTurbineStorage | localStorage | Persistent storage override |
sessionStorage | RevTurbineStorage | sessionStorage | Session storage override |
| Field | Type | Default | Description |
|---|
inferUser | boolean | true | Auto-detect user info from browser APIs |
inferPage | boolean | true | Auto-capture URL, title, referrer |
routerAutoTrack | boolean | true | Track SPA route changes |
| Field | Type | Description |
|---|
exportedConfig | ExportedConfig | Full ExportedConfig snapshot for local execution |
placements | LocalPlacementDataset | Optional static placements dataset |
initialData | object | Static data for local decisions (see below) |
resolvers | object | Optional resolver callbacks (see below) |
storageKey | string | Optional localStorage key override |
getContext | () => Promise<JsonObject> | Reactive context callback |
| Field | Type |
|---|
placementDecisionsByPlacementId | Record<string, RevTurbinePlacementDecision> |
placementsByLookupKey | Record<string, PlacementOutput | null> |
entitlementByHandle | Record<string, EntitlementResult> |
userContextByUserId | Record<string, UserTargetingContext> |
trialStatus | RevTurbineTrialContext |
| Field | Signature |
|---|
getPlacementDecision | (input, placement?, context?) => Promise<RevTurbinePlacementDecision> |
getPlacement | (config) => Promise<PlacementOutput | null> |
checkEntitlement | (handle, context?) => Promise<EntitlementResult> |
fetchUserContext | (userId) => Promise<UserTargetingContext> |
getTrialStatus | () => Promise<RevTurbineTrialContext> |
resolveExportedConfig | () => Promise<ExportedConfig> |
| Flag | Type | Default | Description |
|---|
enableClientCapsEnforcement | boolean | false | Client-side cap enforcement |
enableAutoGatedPlacement | boolean | false | Auto-render gated placements |
enableTrialAutoTriggers | boolean | false | Auto-derive trial lifecycle triggers |
Override individual API endpoints for custom_endpoints mode:
| Field | Default Path |
|---|
decideContext | /api/decide-context |
bootstrapContext | /api/bootstrap-context |
decide | /api/decide |
getPlacement | /api/placement |
checkEntitlement | /api/entitlement |
userContext | /api/user-context |
trialStatus | /api/trial-status |
ingestEvents | /api/events |
touchpointTransition | /api/touchpoint-transition |
placementTypes | /api/placement-types |
surfaceSlots | /api/surface-slots |
Interface for custom storage providers:
interface RevTurbineStorage {
getItem(key: string): string | null;
setItem(key: string, value: string): void;
removeItem(key: string): void;
tenantId: string; // ✅ Required
apiKey: string; // ✅ Required (rt_live_* or rt_test_*)
endpoint: string; // ✅ Required
mode: string; // ✅ Required
tenantId: string; // ✅ Required (can be 'demo')
apiKey: string; // ✅ Required (can be 'local')
endpoint: string; // ✅ Required (can be 'http://localhost')
mode: string; // ✅ Required
runtimeMode: 'local_only'; // ✅ Required
exportedConfig: ExportedConfig; // ✅ Required
tenantId: string; // ✅ Required
apiKey: string; // ✅ Required
endpoint: string; // ✅ Required
mode: string; // ✅ Required
runtimeMode: 'custom_endpoints'; // ✅ Required
endpointOverrides: { // ✅ At least one override required
checkEntitlement?: string;