RevTurbineInitOptions
Options for initializing the RevTurbine SDK.
Example
Section titled “Example”import { initRevTurbine } from '@revt-eng/sdk';
const sdk = initRevTurbine({ tenantId: 'tenant_abc', apiKey: 'rt_live_xxx', endpoint: 'https://api.revturbine.io', mode: 'react',});Properties
Section titled “Properties”analytics?
Section titled “analytics?”
optionalanalytics?:boolean
Analytics/clickstream telemetry opt-out.
Analytics is on by default (true). Set to false to opt out:
the SDK then emits no clickstream events to POST /api/track
across every path (capture / track / batched flush / page-unload).
Locally-registered RevTurbineEventConsumer adapters and
local_only runtime state are unaffected — this flag governs only the
RevTurbine ingest network call.
Note: this opt-out covers the authed clickstream. The separate keyless anonymous SDK-init beacon has its own opt-out (anonymousTelemetry).
anonymousTelemetry?
Section titled “anonymousTelemetry?”
optionalanonymousTelemetry?:boolean
Keyless anonymous SDK-init telemetry opt-out (plan 95).
When no ingestPublicKey is configured, the SDK sends a single
anonymous sdk_init beacon to POST /api/sdk/meta carrying config-shape
counts only (number of plans, entitlements, placements, etc.), the SDK
version, runtime/schema/bundle versions, and a one-way hashed config id —
never any user, account, or PII context. It powers RevTurbine’s
SDK-adoption metrics for installs that haven’t wired an ingest key.
On by default (true). Set to false to opt out entirely; the SDK then
sends no keyless telemetry. When active, the SDK logs a one-time info
console notice naming this flag. Has no effect once an ingestPublicKey
is present (that path uses the authed clickstream instead), nor in
local_only runtime mode.
apiKey
Section titled “apiKey”apiKey:
string
API key for authentication.
configProvider?
Section titled “configProvider?”
optionalconfigProvider?:RevTurbineConfigProvider
Optional provider for RevTurbineConfig-backed data (plans, segments, rules, ui paths).
domainProviders?
Section titled “domainProviders?”
optionaldomainProviders?:AnyDomainProvider[]
Typed domain providers (plan, entitlements, segments, content, rules, traits).
endpoint
Section titled “endpoint”endpoint:
string
Base URL of the RevTurbine API Edge.
endpointOverrides?
Section titled “endpointOverrides?”
optionalendpointOverrides?:Partial<RevTurbineEndpointOverrides>
Optional endpoint overrides used in custom_endpoints mode.
environmentId?
Section titled “environmentId?”
optionalenvironmentId?:string
Environment identifier stamped on every ingested clickstream event
(TrackEvent.environment_id, e.g. 'prod' / 'staging'). Lets a
tenant separate analytics by deployment environment. Defaults to
'default' when omitted.
eventBatching?
Section titled “eventBatching?”
optionaleventBatching?:RevTurbineEventBatchingOptions
Client-side clickstream batching policy (plan 95). Events are buffered and
flushed to POST /api/track on whichever comes first: the batch reaching
RevTurbineEventBatchingOptions.maxBatchSize, the
RevTurbineEventBatchingOptions.flushIntervalMs timer elapsing, or a
page-unload signal (pagehide / visibilitychange: hidden). Tune for
low-volume sessions that would otherwise strand events.
ingestPublicKey?
Section titled “ingestPublicKey?”
optionalingestPublicKey?:string
Public ingest key for SDK clickstream ingestion (POST /api/track).
Mint one in your RevTurbine tenant under Settings → Ingest keys.
This is a tenant-scoped, embeddable public token distinct from
apiKey: it authorizes only event ingestion (the
ingest:write scope) and carries no role authority, so it is safe
to ship in client bundles. When omitted, the SDK falls back to
apiKey for the ingest request — but /api/track accepts
only a public token, so a non-public apiKey fallback will be
rejected. Set this for any integration that emits events.
localRuntime?
Section titled “localRuntime?”
optionallocalRuntime?:RevTurbineLocalRuntimeOptions
Local-only runtime configuration used in local_only mode.
mode:
RevTurbineSdkMode
SDK integration mode.
persistentStorage?
Section titled “persistentStorage?”
optionalpersistentStorage?:RevTurbineStorage
Persistent storage provider (survives page reloads).
Browser default: localStorage. Server default: in-memory.
Override with a Redis/cookie/DB-backed implementation for SSR persistence.
placementBehavior?
Section titled “placementBehavior?”
optionalplacementBehavior?:Partial<RevTurbinePlacementBehaviorFlags>
Opt-in flags for placement decision behavior changes.
Defaults are conservative (false) so existing integrations do not change behavior
until explicitly enabled.
providerFailureSlotBehavior?
Section titled “providerFailureSlotBehavior?”
optionalproviderFailureSlotBehavior?:RevTurbineProviderFailureSlotBehavior
Slot behavior after provider-chain failure disables the SDK.
invisible(default): slots return hidden decisions.placeholder: slots return visible placeholder content.
runtimeMode?
Section titled “runtimeMode?”
optionalruntimeMode?:RevTurbineRuntimeMode
SDK deployment/runtime mode:
revturbine_server(default): standard RevTurbine-hosted endpoints.custom_endpoints: customer-provided endpoint replacements.local_only: no server calls, runtime data initialized locally.
sessionStorage?
Section titled “sessionStorage?”
optionalsessionStorage?:RevTurbineStorage
Session-scoped storage provider (cleared when the tab/session ends).
Browser default: sessionStorage. Server default: in-memory.
tenantId
Section titled “tenantId”tenantId:
string
Your RevTurbine tenant identifier.
uiPathResolvers?
Section titled “uiPathResolvers?”
optionaluiPathResolvers?:RevTurbineUiPathResolverMap
Optional UI path resolver map used by validateUiPathResolvers().