@fullstory/browser
Version:
The official Fullstory browser SDK
60 lines (59 loc) • 3.17 kB
TypeScript
import { FSApi } from '@fullstory/snippet';
/**
* FullStory Client SDK snippet options.
*
* - orgId: Reference for your [Org Id](https://help.fullstory.com/hc/en-us/articles/360047075853) listed in FullStory.
* - namespace: Global object name that contains the FullStory browser API methods and properties. Defaults to `FS`.
* - debug: Debug mode with extra browser console logging.
* - host: The recording server host domain. Can be set to direct recorded events to a proxy that you host. Defaults to `fullstory.com`.
* - script: FullStory script host domain. FullStory hosts the `fs.js` recording script on a CDN, but you can choose to host a copy yourself. Defaults to `edge.fullstory.com`.
* - cookieDomain: Overrides the cookie domain. By default, cookies will be valid for all subdomains of your site; if you want to limit the cookies to a specific subdomain, you can set the domain value explicitly. More information can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622874-Can-the-FullStory-cookie-be-associated-with-a-specific-subdomain-).
* - recordCrossDomainIFrames: FullStory can record cross-domain iFrames. Defaults to `false`. Certain limitations apply and can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622514-Can-FullStory-capture-content-that-is-presented-in-iframes-#h_01F1G333PYKPGZ4B42WDBV3YKV).
* - recordOnlyThisIFrame: FullStory can record the iFrame as its own unique session. Defaults to `false`. Additional conditions apply and can be found [here](https://help.fullstory.com/hc/en-us/articles/360020622514-Can-FullStory-capture-content-that-is-presented-in-iframes-#h_01F1G33B40Q2TPQA8MA7SF8Y5P).
* - devMode: In dev mode FullStory won't record sessions. Any calls to SDK methods will `console.warn` that FullStory is in `devMode`. Defaults to `false`.
*/
export interface SnippetOptions {
orgId: string;
appHost?: string;
assetMapId?: string;
cookieDomain?: string;
debug?: boolean;
devMode?: boolean;
host?: string;
namespace?: string;
recordCrossDomainIFrames?: boolean;
recordOnlyThisIFrame?: boolean;
script?: string;
startCaptureManually?: boolean;
}
/**
* A callback that will be invoked when FullStory has begun a session.
*
* `sessionUrl` contains the URL to the current session.
* `settings` contains the org settings for the current session.
*/
type ReadyCallback = (data: {
sessionUrl: string;
settings: Readonly<object>;
}) => void;
declare global {
interface Window {
_fs_app_host?: string;
_fs_asset_map_id?: string;
_fs_capture_on_startup?: boolean;
_fs_cookie_domain?: string;
_fs_debug?: boolean;
_fs_dev_mode?: boolean;
_fs_host?: string;
_fs_initialized?: boolean;
_fs_is_outer_script?: boolean;
_fs_namespace?: string;
_fs_org?: string;
_fs_run_in_iframe?: boolean;
_fs_script?: string;
}
}
export declare const init: (inputOptions: SnippetOptions, readyCallback?: ReadyCallback) => void;
export declare const isInitialized: () => boolean;
export declare const FullStory: FSApi;
export {};