How It Works
- Your backend creates a viewer token scoped to a specific
tenant_id - The token is passed to your frontend
- Your frontend either embeds the Immutable viewer iframe or queries the public events endpoint directly
- The token expires after the configured TTL
Creating Viewer Tokens
Backend: Generate a Token
- JavaScript
- Python
- Laravel
- cURL
Scoping by Actor
You can also scope a viewer token to a specific actor, so a user only sees their own activity:- JavaScript
- Python
- cURL
Embedding the Viewer
Option 1: Iframe Embed
The simplest integration — embed the Immutable viewer directly in your app:Option 2: React Component
Build a custom activity feed by querying the public events endpoint with the viewer token:TTL Management
Choose a TTL that matches your use case:Refreshing Tokens
Create a backend endpoint that generates fresh tokens on demand:- JavaScript (Express)
- Python (Flask)
- Laravel
Querying Events with a Viewer Token
Viewer tokens work with the same events API, but responses are automatically filtered to the token’s scope:- JavaScript
- cURL
Even if a query doesn’t include
tenant_id as a filter, the viewer token enforces it. A viewer token scoped to org_acme_corp can never see events from other tenants.What’s Next
Embeddable Viewer
Full guide to the Immutable viewer widget.
Events API
API reference for querying events.
Viewer Token API
API reference for creating viewer tokens.
SaaS Activity Tracking
End-to-end example of tracking user activity in a SaaS app.