Skip to main content

SpidifySDK

The SpidifySDK class is the main entry point for the Managed UI implementation.

Constructor

new SpidifySDK(options: SpidifyOptions)

Parameters

ParameterTypeDescription
optionsSpidifyOptionsConfiguration object for the UI mode.

Methods

mount(): Promise<void>

Initializes the session and dynamically injects an <iframe> into the specified DOM container. This is the standard method for an embedded UI experience.

launch(): Promise<void>

Initializes the session and actively redirects the entire parent window to the hosted KYC page (Paystack-style). Requires a redirectUrl in the options to bring the user back.

unmount(): void

Removes the iframe from the DOM and unregisters all window.postMessage listeners. Call this when your component unmounts to prevent memory leaks.

updateStep(payload: SpidifyHandshakeEvent): Promise<void>

Internal: Sends a manual step update to the backend tracking engine. Generally, this is handled automatically by the injected iframe.