generateComponentToken
API Key
Mint a short-lived component token for embedded widgets. This mutation is API-key-only and is available to enterprise API keys.
The returned token is intended for widget/component use, such as the Document Viewer. Pass it to the widget token attribute instead of exposing your Developer Portal API key in browser code.
Input
Return Type
Use expiresIn and expiresAt from the response to decide when to refresh the token.
Example
mutation GenerateViewerToken {
generateComponentToken(input: {
component: LS_DOCUMENT_VIEWER
}) {
token
tokenType
expiresIn
expiresAt
}
}
The documentViewer scope field exists in the schema for forward compatibility but is not currently enforced. Only component is required.