Overview
tokens.create(...) creates a short-lived client token for browser, mobile, desktop, or other non-trusted clients.
Setup
Provide:
- identifierId
- optional identifierLabel
- optional allowedChannels
- optional expiresIn
- optional metadata
Code example
const token = await pulsegrid.tokens.create({
identifierId: "user_123",
identifierLabel: "Kwandile",
allowedChannels: ["demo-channel"],
expiresIn: 3600,
metadata: {
source: "app_backend",
},
});
console.log(token);
Notes
This should normally be called by your backend after authenticating the real user in your own application.