0.1.1. The types come straight from the SDK’s published typings.
Both entry points ship as ESM and CommonJS, with TypeScript declarations.
kyi()
Opens the widget and returns a handle to it.
Calling
kyi() does the following:
- It injects one
<style id="bluprynt-kyi-styles">element into<head>, once per page. - It appends a backdrop and a drawer (
role="dialog",aria-modal="true") to<body>. - It loads
https://app.bluprynt.com/widget/<scope>?token=<accessToken>&embed=truein an iframe inside the drawer.
Scopes
See every screen in Verification flow.
Callbacks
The SDK only passes on messages that come from a
bluprynt.com origin and from its own iframe. Messages from anything else are ignored.
KYIWidget
Drawer behavior
generateToken()
Signs a short-lived access token for one of your members. Server only.
The result is a compact JWT signed with HS256:
Header
Payload
iat is the signing time and exp is iat + expiresIn, both in Unix seconds. The values above are an example. To sign tokens in another language, see Access tokens.
Errors
All errors are thrown synchronously fromkyi(), or rejected from generateToken(), as plain Error objects.
Problems the SDK can’t detect, such as an origin that isn’t allowlisted, a wrong partner ID or an expired token, show up inside the drawer. See Errors and troubleshooting.
TypeScript types
The source and typings also accept a
'modal' mode. Bluprynt’s official SDK docs cover only drawer, so treat modal as unsupported.