Identifying visitors
Tell the chat agent who the visitor is with a signed identity assertion
1. Get your identity secret
2. Sign assertions on your backend
Claim
Required
Value
import { SignJWT } from "jose"
const secret = new TextEncoder().encode(
process.env.LIMIO_CHAT_IDENTITY_SECRET
)
export async function signChatAssertion(userId) {
return new SignJWT({ sub: userId })
.setProtectedHeader({ alg: "HS256" })
.setIssuedAt()
.setExpirationTime("15m")
.sign(secret)
}import os
import time
import jwt # PyJWT
def sign_chat_assertion(user_id: str) -> str:
now = int(time.time())
return jwt.encode(
{"sub": user_id, "iat": now, "exp": now + 900},
os.environ["LIMIO_CHAT_IDENTITY_SECRET"],
algorithm="HS256",
)3. Hand the assertion to the snippet
Sign-in and sign-out without a page reload
How sessions behave
Last updated
Was this helpful?

