πŸ”ŒKYI Widget SDK

Embed Bluprynt KYI directly into your web application.

KYI Widget SDK

Embed Bluprynt's KYI (Know Your Issuer) verification directly into your web application. The KYI Widget SDK lets partners offer token authentication to their users without redirecting them to the Bluprynt platform.

circle-info

The KYI Widget SDK is available as an npm package: @bluprynt/kyi-widget-sdkarrow-up-right. Use the playgroundarrow-up-right to test the widget before integrating.


How It Works

  1. Get your credentials β€” request a SECRET_KEY and partner ID from Bluprynt as part of your integration onboarding.

  2. Generate access tokens β€” implement JWT generation on your backend using your secret key. Tokens are short-lived and scoped to individual users.

  3. Embed the widget β€” use the SDK on your frontend to render the KYI flow in a modal, drawer, or inline container.

The widget runs in a secure iframe and communicates with your application via postMessage. Your users complete the entire KYI process without leaving your platform.


Installation

npm install @bluprynt/kyi-widget-sdk
yarn add @bluprynt/kyi-widget-sdk
pnpm add @bluprynt/kyi-widget-sdk

Quick Start

1. Generate an Access Token (Server-Side)

Access tokens authenticate widget sessions. Generate them on your backend β€” never expose your secret key to the client.

If you're using Node.js, the SDK includes a server-side helper:

Using a different backend language? Generate a JWT signed with your SECRET_KEY using any JWT library. The token payload must follow this structure:

2. Embed the Widget (Client-Side)

Use the access token to render the KYI widget in your frontend:


Display Modes

The widget supports three display modes depending on your UI needs.

Displays the widget in a centered modal overlay. Best for primary user flows where KYI is the main action.

Drawer

Displays the widget in a slide-in panel from the right. Good for secondary flows or multi-step UIs where the user may want to reference other content.

Inline

Embeds the widget directly into a specified container element. Best for dedicated verification pages or when the widget should be part of the page layout.


Widget Scopes

The scope parameter determines which view the widget displays. This lets you use the same SDK for different parts of the KYI workflow.

Scope
Description

kyi

New KYI application flow β€” the full verification process

asset-list

View the list of the user's verified assets

wallet-verification

Tokenless wallet verification without associating a specific token

wallet-list

View the list of the user's connected wallets


Checking KYI Status (Server-Side)

Query the current KYI verification status for a user from your backend:

This is useful for checking whether a user has already completed KYI before showing the widget, or for updating your own records after verification.


Framework Examples

React


API Reference

kyi(mode, scope, accessToken, options?)

Creates a KYI widget instance.

Parameters:

Parameter
Type
Description

mode

'inline' | 'modal' | 'drawer'

Widget display mode

scope

'kyi' | 'asset-list' | 'wallet-verification' | 'wallet-list'

Which view to display

accessToken

string

JWT access token from generateToken

options

KYIOptions

Optional configuration

Options:

Option
Type
Description

parentElement

HTMLElement

Container element. Required for inline mode. Ignored for modal and drawer.

onComplete

() => void

Called when the KYI flow completes successfully

onClose

() => void

Called when the widget is closed by the user

onError

(error: Error) => void

Called when an error occurs

onReady

() => void

Called when the widget iframe is loaded and ready

Returns: KYIWidget

Property
Type
Description

iframe

HTMLIFrameElement

Reference to the widget iframe element

destroy

() => void

Removes the widget from the DOM and cleans up event listeners

generateToken(options) β€” Server-Side

Generates a JWT access token for widget authentication.

Option
Type
Description

issuer

string

Your partner identifier provided by Bluprynt

secretKey

string

Your Bluprynt secret key

userId

string

Your internal user identifier

expiresIn

number

Token expiry in seconds. Defaults to 3600.

Returns: Promise<string>

checkStatus(options) β€” Server-Side

Checks the KYI verification status for a user.

Option
Type
Description

issuer

string

Your partner identifier

secretKey

string

Your Bluprynt secret key

userId

string

Your internal user identifier

Returns: Promise<KYIStatus>


Security

  • Never expose your SECRET_KEY on the client side. Token generation must happen on your backend.

  • Access tokens are short-lived. Generate a fresh token for each widget session. The default expiry is 1 hour.

  • The widget uses postMessage for secure iframe communication. It does not require cookies or local storage.


Resources

For integration support or to request your partner credentials, contact product@bluprynt.com.

Last updated