OptionalbackendOptionalcontextA function that returns a friendly name for a given context. This name will be used to identify the session in the observability UI.
contextFriendlyName: (context: LDContext) => {
if(context.kind === 'multi' && context.user?.email) {
return context.user.email;
} else if(context.kind === 'user') {
return context.key;
}
// Use the default identifier for contexts which don't contain a user.
return undefined;
}
The context to get a friendly name for.
The friendly name for the context, or undefined to use the default identifier.
OptionalmanualSpecifies if Highlight should not automatically initialize when the class is created.
This should be used with .start() and .stop() if you want to control when Highlight records.
While start() has not been called, calls that can be deferred (logs,
errors, metrics, track) are kept in memory and delivered once
start() runs. start() and stop() can safely be called before the
SDK has initialized: a start made too early resolves once the SDK is
attached. Calls that cannot be deferred (synchronous span callbacks) run
their callback on a no-op span while the SDK is not started.
OptionalserviceSpecifies the name of the app.
OptionalsessionBy default, session data is stored in the localStorage of the browser.
Set to true to store session data in a cookie instead.
This can help with compliance for cookie-consent regulation.
OptionalsessionSet the Domain attribute of the session cookie so the same session can
be continued on different subdomains (e.g. app.example.com and
checkout.example.com both see a cookie set for example.com).
Only applies when sessionCookie is set to true.
By default, the cookie is scoped to the exact host that created it.
OptionalsessionKey to use to determine the sessionSecureID in order to override session generation logic. If a sessionKey is provided, the session will be combined with the previous session with the same key. Otherwise, the current session logic will be used to generate a sessionSecureID.
OptionalstorageSet to sessionStorage to bypass all window.localStorage usage.
This can help with compliance for cookie-consent regulation.
Using sessionStorage will cause app close+reopens to start a new highlight session,
as the session ID will not persist.
OptionalversionSpecifies the version of your application. This is commonly a Git hash or a semantic version.
Specifies where to send Highlight session data. You should not have to set this unless you are running an on-premise instance.