Skip to main content
Use AmityUserTokenManager or the TypeScript createUserToken(...) helper to create user credentials for flows that require a user access token. This includes access to some beta features and server-side API workflows.
The generated access token is not used by normal client SDK login. Create and consume these tokens only from a backend, tool, or trusted workflow where the token is not exposed to end users.

Parameters

Create a user token

To create a user token, pass the user’s identifier and optional secure-mode credentials from a trusted workflow. Create the token with the SDK surface for your platform.

Token security

  • Store tokens securely on the server side.
  • Use encryption for token storage.
  • Implement token rotation policies.
  • Never expose tokens in client-side code.
  • Always use HTTPS for token transmission.
  • Implement proper authentication headers.
  • Use secure communication channels.
  • Log token usage for audit purposes.

Best Practices

  • Cache tokens to avoid unnecessary creation.
  • Implement token validation before usage.
  • Use connection pooling for better performance.
  • Handle token expiration gracefully.
  • Implement comprehensive error handling.
  • Log all token operations for debugging.
  • Provide meaningful error messages.
  • Implement retry logic for transient failures.
  • Batch token operations when possible.
  • Use background processing for token creation.
  • Implement caching strategies.
  • Monitor token usage patterns.

User Authentication

Learn about standard user login and authentication.

API Integration

Explore social.plus API documentation.