Skip to main content

@idhub/identity-provider-fullstory

Interfaces

FullStoryProviderConfig

Defined in: types.ts:17

Properties

fs?

optional fs?: FullStoryFunction

Defined in: types.ts:37

Testability / injection hook. Since there is no npm SDK to mock, production usage relies on the global window.FS function installed by FullStory's snippet (defaulted here via (globalThis as any).FS). Tests — and any host environment that wants to control FS SDK loading itself — can inject a substitute function here instead of stubbing globalThis.

orgId

orgId: string

Defined in: types.ts:27

FullStory org id, per the plan's Appendix A config shape. Not currently sent as an argument to any FS command — setIdentity/anonymize don't take an org id, and the org association is established by the window['_fs_org'] value baked into FullStory's script snippet, not by this provider. Kept on the config type for parity with the documented contract and so a future FS command that does need it (or multi-org validation) can use it without a breaking config change.

Type Aliases

FullStoryFunction

FullStoryFunction = (command, options?) => void

Defined in: types.ts:13

Signature of the global FS function FullStory's Browser SDK snippet installs on window.FS. FullStory does not publish an npm client for the Browser SDK — it is loaded via a script snippet that exposes this global function, so there is no vendor SDK package to depend on (as an npm dep or a peerDependency). This type models only the two commands this provider issues (setIdentity, anonymize); FullStory's real global exposes many more (event, setVars, restart, shutdown, etc.) that are out of scope here.

Parameters

command

string

options?

Record<string, unknown>

Returns

void

Functions

fullStoryProvider()

fullStoryProvider(config): IdentityProvider

Defined in: provider.ts:43

Implements IdentityProvider for FullStory, per the plan's vendor research (Appendix A / FullStory row):

  • onAnonymous is a documented no-op — FullStory's own guidance is to never call identify for anonymous/guest state (use "Set User Properties" instead, which is out of scope for this MVP). This makes ZERO calls to FS of any kind.
  • onIdentify calls FS('setIdentity', { uid, ...traits }). setIdentity auto-merges all prior anonymous sessions on the device into this identity — no separate alias call exists or is needed.
  • onReset calls FS('anonymize'), never setIdentity/identify again. FullStory's identify is write-once per session: re-identifying with a different uid mid-session splits the session instead of merging, so logout must go through anonymize() to cleanly start a new anonymous session instead of ever re-identifying with the new anonymous id.

Parameters

config

FullStoryProviderConfig

Returns

IdentityProvider