Embedding Quickstart
Before you start
Step 1: Generate a token from your backend
// Server-side only
async function getFastnToken({ userEmail, userName }) {
const res = await fetch("https://live.gcp.fastn.ai/api/v1/embed/token", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.FASTN_API_KEY}`,
"Content-Type": "application/json",
// Required only for fsk_test_ keys:
"X-fastn-Test-Mode": "true",
},
body: JSON.stringify({
endOrgId: process.env.FASTN_END_ORG_ID,
userEmail,
userName,
}),
});
const json = await res.json();
// The token is nested under `data`
return json.data.token;
}Step 2: Expose the token to your frontend
Step 3: Render the iframe
Step 4: Verify
If the iframe is blank
Last updated
Was this helpful?

