Onboarding Element
The Onboarding element embeds the frameOS KYC and compliance flow directly in your application as a modal. Unlike hosted onboarding sessions, no redirect is required — the flow opens inline and your users never leave your page.
Before opening the component, your server must create an account and request the capabilities you want to collect.
<script src="https://js.framepayments.com/v1/index.js"></script>
<script>
(async () => {
const onboarding = await Frame.createOnboarding("<PUBLISHABLE_KEY>");
onboarding.setAttribute("merchant-name", "My Company");
onboarding.onSuccess = (account) => {
console.log("Onboarding complete", account.id);
};
onboarding.onClose = () => {
console.log("Modal closed");
};
// Open after your server creates the account and requests capabilities
onboarding.open("<ACCOUNT_ID>");
})();
</script>
Before you begin
The onboarding component requires an account to exist with capabilities already requested before you call open(). This must happen server-side using your secret key.
1. Create an account
curl --request POST \
--url https://api.framepayments.com/v1/accounts \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"type": "individual",
"profile": {
"individual": {
"email": "user@example.com"
}
}
}'
2. Request capabilities
Capabilities determine which steps appear in the onboarding flow. Request only what your integration needs.
curl --request POST \
--url https://api.framepayments.com/v1/accounts/<ACCOUNT_ID>/capabilities \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"capabilities": ["kyc", "phone_verification", "card_receive"]
}'
See Capabilities for the full list of available capabilities.
3. Pass the account ID to your frontend and call onboarding.open(accountId).
Prefill as much profile information as you know when creating the account — this reduces the number of fields the user has to fill in and improves completion rates.
API Reference
Frame.createOnboarding(publishableKey)
A lightweight factory that creates the onboarding web component. Unlike Frame.init(), this does not load Evervault, FingerprintJS, or Sift — it only loads what's needed for the onboarding flow.
Parameters
Your publishable API key from the Frame Dashboard.
Returns
Returns a FrameOnboarding element instance.
const onboarding = await Frame.createOnboarding("<PUBLISHABLE_KEY>");
Attributes
Set attributes on the element to customize the modal appearance.
Attributes
Display name shown inside the onboarding modal.
URL of the merchant logo shown in the modal header.
onboarding.setAttribute("merchant-name", "My Company");
onboarding.setAttribute("merchant-logo", "https://example.com/logo.png");
onboarding.open(accountId)
Loads the onboarding steps for the account and opens the modal. The account must already exist and have capabilities requested before calling open().
onboarding.open("acct_...");
onboarding.close()
Programmatically closes the modal.
onboarding.close();
Callbacks
Assign callbacks directly on the element to respond to onboarding events.
Callbacks
Called when all onboarding steps have been completed successfully. Receives the completed account object.
Called when a step encounters an error.
Called each time an individual step is completed.
Called when the user closes the modal.
onboarding.onSuccess = (account) => {
console.log("All steps complete", account.id);
};
onboarding.onError = ({ step, error }) => {
console.error("Error on step", step, error.message);
};
onboarding.onStepComplete = (step) => {
console.log("Step complete:", step);
};
onboarding.onClose = () => {
console.log("Modal closed");
};