Get Started
1
Load the SDK
Add Swap in the production URL when you’re ready to go live. See Environments.
tight.js to your page with a <script> tag:2
Initialize with an access token
3
Render a page
Loading the SDK
Loading the script creates a single global instance atwindow.Tight. Load it only once per page: a second load logs
an error and has no effect.
Environments
The script URL selects which Tight API environment the SDK targets:
Load the URL for the environment you’d like to target, and use an
accessToken issued for that same environment. You
can obtain an applicable accessToken via the Tight Authentication Endpoint.
Initializing the SDK
Callinit with an access token before rendering anything. This authenticates the SDK and resets it to a clean state,
removing any existing page and listeners.
init does not render a page by itself. Call render afterward to display content.
Refreshing credentials
Access tokens expire after 3600 seconds. When your token expires or changes, callauth instead of init. It updates
the token in place without clearing an already-rendered page or your registered listeners.
Rendering a page
Callrender to display a page inside a container element in your document.
render again with a different page value updates the displayed page. Calling it with a different
containerId moves the page to that container.
Supported page values
Listening for events
UseregisterListener to react to actions that happen inside the rendered page, such as a form opening or a workflow
completing. You might route a user back to your own invoicing product, gate functionality behind your own paywall, or
send analytics when a user opens a dashboard tile.
unregisterListener with the same key:
Supported event keys
Each listener receives a payload describing the result of the action, including whether it succeeded and any associated
data or error details.