Cladior · Reference

SDK Reference

Load with one script tag. Everything else is automatic. The methods below are available if you need them; most integrations only use getUserInfo().

Loading

HTML
<script
  src="https://www.cladior.com/sdk/v2.js"
  data-cladior-site="your-app-id"
></script>

Place before any inline scripts that use cladiorPass. No defer or async.

Methods

MethodReturnsWhat it does
cladiorPass.getUserInfo()Promise<{avatar_url, theme}>Returns the user's profile. Fields are null if the user hasn't granted that scope. Call inside a pass:connected listener.
cladiorPass.getToken()string | nullThe current session token, or null. Only needed for custom domain setups where you want to pass the token to your own backend manually.
cladiorPass.login()Promise<void>Opens the connect popup. The SDK calls this automatically; you only need it for a manual "Connect" button.
cladiorPass.logout()voidClears the session.
cladiorPass.isAuthenticatedbooleanTrue if a valid session is stored.

Event

EventFires when
window: pass:connectedAfter every successful connect, including session restore on page load. Use it to call getUserInfo().

Scopes

Set scopes per app in the dashboard, not in code. Users see and accept them on the connect screen.

ScopeWhat it unlocks in getUserInfo()
avataravatar_url: the user's profile picture URL
themetheme: "light" or "dark"