The recommended way to embed a dashboard is to fetch a secure token from your backend and dynamically create the iframe. This keeps your API credentials safe.
Security Best Practice: Never expose your API credentials (API Key ID and
Secret Key) in your frontend code. Always generate tokens on your backend
server and fetch them from your frontend.
To generate tokens on your backend, see the Backend: Generating Embed
Tokens section below for implementation
examples in Python, TypeScript, PHP, and Go.
To get the dashboardId for your dashboard, navigate to your Papermap workspace and click the top-left dropdown menu to view all dashboards. Select the “Show All Dashboards” section to view information about all dashboards including the dashboardId
Why This Approach is Secure: - Your API credentials stay on the server,
never exposed to the browser - Tokens are time-limited.
Each user gets a fresh token when they load the page - You can add
authentication checks before generating tokens
For Development/Testing Only: This approach exposes your API credentials
in the frontend code. Only use this for local development or testing. Never
use this in production applications.
For quick testing or prototyping, you can generate tokens directly in the frontend:
<!-- Your HTML --><div class="dashboard-container"> <iframe id="dashboard-iframe" width="100%" height="600" frameborder="0" allowfullscreen > </iframe></div>
When to Use Frontend Generation: - ✅ Local development and testing - ✅
Internal tools with restricted access - ✅ Quick prototypes and demos - ❌
Never in production (credentials exposed to users) - ❌ Public-facing
applications - ❌ Applications requiring authentication
Security Note: Always store your API credentials in environment variables,
never hardcode them in your source code. The token is valid for how long you set it for but it is recommended to be 1 hour for security sake.