Installation
The JavaScript SDK is available by URL. Choose the URL that matches your credentials and environment.- Production
- Sandbox
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 yourclient_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: use the APIs to create the application, associate the property, and generate an application participant’s onboarding token; then use the SDK to launch the profile session with that token.1. Using the APIs — generate an onboarding token
Using your Bearer access token (see the Authentication guide):- Create the property with the Property Management API and keep its
property_id. - Create an application with Create Application, passing the required
titleand the tenant emails and marking exactly one entry withis_lead: true. A guarantor cannot be the lead: mark guarantors withis_guarantor: trueandis_lead: false(is_guarantordefaults tofalsewhen omitted).titleis required. Keep the returnedapplication_id. Application creation is email-only: every participant starts as pending, and invitations are sent to all non-lead emails, including guarantors, without looking up or creating tenant accounts.
- Production
- Sandbox
- Call Generate Tenant Onboarding Token with the email of the participant starting onboarding. This resolves or initializes the tenant and stores the resolved tenant ID on the participant. The participant’s consent remains
pendinguntil onboarding is completed; only then does SKOR change theirconsent_statustoaccepted. In the standard flow, generate a token separately for each participant when they begin onboarding.
- Production
- Sandbox
tenant_id, is_profile_outdated, requires_login_with_skor, and a nullable token. New tenants and existing incomplete tenants already linked to your API key receive an onboarding token directly. If an existing account is not yet linked to your key, SKOR instead returns a restricted verification token with requires_login_with_skor: true. Pass that token to the SDK in the same way: the iframe asks the tenant to Login with SKOR and verify a one-time code. After successful verification, SKOR links the key and displays Profile linked. If the profile is incomplete, a Continue onboarding action appears; selecting it redirects the tenant to onboarding and resumes from their stored step. If the profile is outdated, a Redo onboarding action appears instead and restarts the iframe onboarding flow. A current completed profile does not show either action. Later sessions for that tenant and key can use the normal onboarding token without another OTP. The restricted token does not log the tenant into SKOR or expose a tenant login token.
For an existing incomplete tenant, onboarding_status and consent_status remain PENDING after OTP; consent changes to accepted only after onboarding is completed. For an existing current tenant, onboarding_status remains COMPLETED, while pending application consent is accepted after OTP verification. If the profile is outdated, the same OTP flow first displays Profile linked, followed by a Redo onboarding action. That action restarts the normal iframe onboarding flow; the session completes only after the renewed profile is saved. If consent was already accepted and the profile is current, SKOR returns token: null.
An administrator can optionally enable application profile management for an API
key. In this SDK-only mode, Generate Tenant Onboarding Token starts a session for
the lead tenant, who can complete each participant’s profile from one iframe.
Existing profiles require email-code verification before they are linked. New or
incomplete profiles continue through onboarding, while outdated profiles restart
onboarding. The iframe shows every participant’s progress and closes only after
all profiles are complete and the lead submits the application. Contact your SKOR
administrator to enable or change this setting.
2. Using the SDK — launch the session
CallstartProfileSession with the onboarding token and the id of the container element that should host the session.
TENANT_ONBOARDING_COMPLETED browser message to the SDK. For an outdated profile, OTP verification alone does not post the completion message or close the iframe; the message is posted after the tenant finishes the restarted onboarding flow. The SDK consumes this message, closes the iframe, and invokes onSkorAnalysisRunning. Status polling remains active as a fallback if the browser message is not received.
This browser message is separate from webhook delivery. If a webhook is registered for the modular API key, the backend also sends a signed TENANT_ONBOARDING_COMPLETED webhook with the completed tenant ID.
Landlord report session
Show the landlord report for a specific property and application. It uses the sameSkor({ clientId }) setup as a tenant session, but the report requires both a propertyId and an applicationId in addition to the landlord token.
1. Using the API — generate a landlord token
Use your API access token. No request body is required.- Production
- Sandbox
propertyId (from the Property Management API) and applicationId (from POST /applications/create-application) you want to display.
2. In the browser — show the report
Add a container to your page:propertyId and applicationId are required — the SDK will not render the report if either is missing.
onLoad, onError, onCancel) and the height option work the same as for tenant sessions.
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
height is not provided, it defaults to 500px.