This page is specifically about the multi-tenant iframe token flow. If you are
embedding Papermap through
@papermap/papermap, see React
Components for the component
integration flow and how it uses workspaceId, dashboardId, and backend
token generation.Overview
Iframe tokens allow you to securely embed Papermap dashboards in your application. Each token:- Is signed with HMAC-SHA256 for security
- Has a configurable expiration time
- Is specific to a tenant and dashboard
- Can only be used for the specified dashboard
Token Structure
The token contains:api_key_id: Your API key identifierworkspace_id: Your workspace IDtenant_id: The tenant identifierdashboard_id: The specific dashboard IDvalid_until: Unix timestamp when token expiressignature: HMAC signature for verification
Generating Iframe Tokens
The tenant-aware
dashboardId and backend provisioning model described here
can still be relevant when your application uses React components, but this
page documents the iframe-specific token flow.Using the Token in Frontend
Once you have the token, embed the dashboard using an iframe:React Example
Workflow Diagram
Token Refresh
Since tokens expire, implement a refresh mechanism:Security Considerations
Tenant Access Verification
Token Expiration
- Advisable: 1 hour (3600 seconds)
- Configurable based on your security requirements
- Shorter expiration = more secure, but requires more frequent refreshes
- Longer expiration = better UX, but higher security risk
Best Practices
- Generate tokens on-demand: Don’t pre-generate and store tokens
- Use HTTPS: Always serve your application over HTTPS
- Implement token refresh: Refresh tokens before they expire
- Log token generation: Monitor for unusual access patterns
- Rate limit: Prevent abuse by rate limiting token generation
Next Steps
API Endpoints
Set up REST API endpoints for dashboard operations
Security Best Practices
Learn about security considerations for production

