ReadonlydataDataLayer facade, mirroring the native Prism DataLayer module.
ReadonlyinstanceStable id addressing this instance in every native call. Equal to the
SDK's TealiumConfig.key, the string "{account}-{profile}", so it also
matches the key this class caches instances under (see create).
ReadonlytraceTrace controls, namespaced to mirror the native Prism Trace module.
Shuts down the native instance.
Calling this method again on a shut-down instance resolves immediately. After shutdown, calls on this instance reject with ErrorCode.INSTANCE_SHUT_DOWN. Call Tealium.create again to get a new instance for the same account and profile.
A Promise that resolves after the native SDK receives the shutdown request. It rejects with ErrorCode.NATIVE_MODULE_NOT_REGISTERED if the native module is missing.
Tracks an event or a view.
The Promise rejects with a TealiumError if the instance is shut
down or the native SDK reports a failure. It rejects with a plain Error
if data cannot be serialized, for example if it contains a BigInt or a
circular reference.
Name of the event or view.
Dispatch type. Defaults to "event".
Optionaldata: JsonValueObject
Data to attach to the dispatch. TypeScript rejects values
that are not JsonValue types. At runtime, track serializes
data with JSON.stringify, so it silently omits object properties
whose values are functions, symbols, or undefined.
A Promise that resolves with the TrackResult. The result reports whether the SDK accepted or dropped the dispatch.
StaticcreateCreates a Tealium instance for an account and profile, or returns the existing one.
If an instance already exists for the same account and profile, this
method logs a warning and returns it. It ignores newly passed
environment, settingsFile, settingsUrl, and logLevel in that case.
The optional arguments mirror the settings sources of the native
TealiumConfig. An omitted argument leaves that source unconfigured. The
settings precedence is local < remote < programmatic on both platforms.
A key in settingsUrl (remote) overrides the same key in settingsFile
(local). logLevel (programmatic) overrides both.
Tealium account name.
Tealium profile name.
Environment name, such as dev, qa, or prod. See
Environment.
OptionalsettingsFile: string
Name of a JSON settings file bundled with the app.
It provides the local settings, which have the lowest priority. On iOS
this is a resource name in the main bundle, and the .json extension is
optional. On Android this is a file name in the assets/ directory. The
native SDK skips local settings silently if the file is missing or
invalid.
OptionalsettingsUrl: string
Full URL of a remote JSON settings resource. The native SDK fetches and caches these remote settings, which have middle priority, and refreshes them at the configured interval. Without a URL, the SDK fetches no remote settings.
OptionallogLevel: LogLevel
Log verbosity of the native Prism SDK. See LogLevel.
The Tealium instance. Native initialization continues asynchronously, so a native failure does not make this method throw. Later calls on the instance reject instead.
TealiumError with code ErrorCode.NATIVE_MODULE_NOT_REGISTERED if the native module is missing. The error is thrown synchronously.
A Tealium Prism instance for one account and profile.
Get an instance with Tealium.create. The constructor is private. Every instance method that talks to the native SDK returns a Promise. Tealium.create is synchronous. After Tealium.shutdown, those Promises reject with ErrorCode.INSTANCE_SHUT_DOWN, except that calling Tealium.shutdown again resolves.
Example