Skip to main content
SKOR currently provides a JavaScript SDK. More SDKs will be available soon. Use the SDK when you want an iframe-based integration where SKOR manages the tenant workflow and your application launches the profile session.

Installation

The JavaScript SDK is available by URL. Choose the URL that matches your credentials and environment.
To test in the sandbox, use https://dev-api.skortorent.com/sdk/skor.js together with sandbox credentials and the https://dev-api.skortorent.com/api/v1 API base URL. Do not mix sandbox tokens or credentials with the production SDK.

Initialize

After including the SDK, initialize it with your client_id.
The SDK is initialized with your public client_id. Your client_secret is used only for server-side calls and must never be exposed in browser code. See the Authentication guide for how to generate a server access token.

Start a profile session

Starting a profile session is a two-part flow: your server mints a tenant onboarding token, and your browser launches the session with that token.

1. On your server — mint an onboarding token

Using your Bearer access token (see the Authentication guide):
  1. Create the tenant with Create Tenant and keep the returned id (the tenantId).
  2. Generate an onboarding token for that tenant with Generate Onboarding Token:
The response returns a short-lived, tenant-scoped token. Pass this token to your browser page.

2. In the browser — launch the session

Call startProfileSession with the onboarding token and the id of the container element that should host the session.
The SDK automatically tracks the session’s progress (via Tenant Profile Status) and drives the callbacks below. You do not need to call the status endpoint yourself.

height

The height property controls the height of the embedded iframe. It accepts either a CSS height value or a number:
  • CSS height values such as "500px", or "800px"
  • A number, which is treated as pixels, such as 600
If height is not provided, it defaults to 500px.

Callbacks

You can provide callback functions to handle events during the profile session.

onLoad

Triggered when the profile session loads successfully.

onSkorAnalysisRunning

Triggered when profile registration is complete and SKOR analysis is running. During this time, you may want to show a loader because the profile session UI cannot be shown until analysis is complete.

onCancel

Triggered when the user cancels the profile session or when the cancel method is called.

onError

Triggered when an error occurs during the profile session.

onProfileReady

Triggered when the profile session is ready to be used.
Review the Authentication guide before using the SDK in production.