Authorizations
API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Body
application/json
Try our new Claude Code Skill to automatically integrate Hyperspell into your project
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: 'My API Key',
});
const token = await client.auth.userToken({ user_id: 'user_id' });
console.log(token.token);{
"token": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}Use this endpoint to create a user token for a specific user. This token can be safely passed to your user-facing front-end.
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: 'My API Key',
});
const token = await client.auth.userToken({ user_id: 'user_id' });
console.log(token.token);{
"token": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Was this page helpful?