Authenticated embeds
An authenticated embed shows a private Felt map inside your own application, to people who don't have Felt accounts. Your backend mints a short-lived embed token for the map, and your page passes it to Felt.embed. Your users sign in to your app the way they already do. Felt never sees their passwords, you don't create Felt accounts for them, and you don't sync users or permissions between the two systems: your app decides who gets a token.
How it works
A signed-in user of your app opens a page with a map.
Your server decides which Felt map that user may see, then calls the Felt API to mint an embed token for that map.
Your page calls
Felt.embedwith the map ID and the token.Felt renders the map, with its styling, legend, popups and components, and keeps it live: edits made to the map in Felt appear in the embed.
Step 1: mint a token on your server
Call POST /api/v2/maps/{map_id}/embed_token with your API token. The user_email query parameter is required. Pass the email of the person who will view the map; Felt uses it to attribute views. That person doesn't need a Felt account.
curl -X POST \
-H "Authorization: Bearer ${FELT_API_TOKEN}" \
"https://felt.com/api/v2/maps/${MAP_ID}/embed_token?user_email=jane%40example.com"// Express route: mint a token for the signed-in user's map.
app.get("/api/felt-token", requireLogin, async (req, res) => {
const mapId = mapIdForCustomer(req.user.customerId); // your own lookup
const url = new URL(`https://felt.com/api/v2/maps/${mapId}/embed_token`);
url.searchParams.set("user_email", req.user.email);
const r = await fetch(url, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.FELT_API_TOKEN}` },
});
if (!r.ok) {
console.error(r.status, await r.text());
return res.status(502).json({ error: "Could not load the map" });
}
const { token, expires_at } = await r.json();
res.json({ mapId, token, expiresAt: expires_at });
});import os
import requests
def mint_embed_token(map_id: str, user_email: str) -> dict:
r = requests.post(
f"https://felt.com/api/v2/maps/{map_id}/embed_token",
params={"user_email": user_email},
headers={"Authorization": f"Bearer {os.environ['FELT_API_TOKEN']}"},
)
r.raise_for_status()
return r.json() # {"token": "...", "expires_at": "..."}A successful response looks like this:
{
"token": "felt_et_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_at": "2026-10-06T21:04:11"
}Never call this endpoint from the browser: it would expose your API token. Only the embed token goes to the client.
A Team workspace with Platform can call this endpoint even though the Team plan doesn't include the rest of the REST API.
Step 2: embed the map with the token
Give the container an explicit height; a zero-height div renders nothing. If you're not using the SDK, you can put the token on an iframe URL instead:
Token lifetime and authorization
Mint a fresh token for each page load. A token lasts 12 hours, which covers a working session in one tab, reconnects included. When it expires, the embed asks the visitor to refresh, and your page mints a new one.
A token grants view access to one map. Anyone holding it can view that map until it expires, so treat it like a session credential and only hand it to the user you minted it for.
Tokens can't be revoked individually. An open embed re-checks every 15 minutes that the workspace still has access to authenticated embeds. To cut off a user, stop minting tokens for them; their existing token expires within 12 hours. Deleting the map ends access to it.
Viewers can't edit. Token viewers see the map read-only. To let them download layer data, turn on Viewer permissions: Export data in the map's settings.
Serving each customer their own data
The token is the security boundary, and it's scoped to a map. To keep one customer's data away from another's, give each customer their own map and mint tokens only for the map that customer is allowed to see. A common pattern is a template map that you duplicate per customer with the REST API (POST /api/v2/maps/{map_id}/duplicate), then point at that customer's data.
Filters set with setLayerFilters on a shared map change what's displayed, not what's accessible. Use them to focus a view, never to hide one customer's data from another.
Usage and limits
Every embed load counts as a map view, authenticated or not, against your plan's monthly allowance. When the workspace reaches its map-view limit, embeds show an over-limit page until the month resets or you add capacity. See Plans, access and limits.
Token viewers don't use viewer spots and need no seats.
Troubleshooting
401 with "Embed tokens need the Platform add-on" when minting
The workspace doesn't have Platform.
Add Platform in your workspace's billing settings.
401 invalid_access_token when minting
The API token is missing, revoked, or from a different workspace than the map.
Use a token created in the map's workspace. See Authentication.
Felt.embed rejects after a few seconds with "Failed to load Felt map"
Either the workspace has no SDK access (the map appears but can't be controlled), or the workspace is over its map-view limit (the embed shows an over-limit page).
Check that Platform is active and that the workspace is under its map-view limit.
The embed asks the visitor to refresh
The token expired.
Mint a new token on page load.
A blank area where the map should be
The container has no height, or the iframe URL uses /map/ instead of /embed/map/.
Set a height. Only /embed/map/… URLs can be framed by other sites.
Last updated
Was this helpful?