Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CreateChatTokenCommand

Creates an encrypted token that is used by a chat participant to establish an individual WebSocket chat connection to a room. When the token is used to connect to chat, the connection is valid for the session duration specified in the request. The token becomes invalid at the token-expiration timestamp included in the response.

Use the capabilities field to permit an end user to send messages or moderate a room.

The attributes field securely attaches structured data to the chat session; the data is included within each message sent by the end user and received by other participants in the room. Common use cases for attributes include passing end-user profile data like an icon, display name, colors, badges, and other display features.

Encryption keys are owned by Amazon IVS Chat and never used directly by your application.

example

Use a bare-bones client and the command you need to make an API call.

import { IvschatClient, CreateChatTokenCommand } from "@aws-sdk/client-ivschat"; // ES Modules import
// const { IvschatClient, CreateChatTokenCommand } = require("@aws-sdk/client-ivschat"); // CommonJS import
const client = new IvschatClient(config);
const command = new CreateChatTokenCommand(input);
const response = await client.send(command);
see

CreateChatTokenCommandInput for command's input shape.

see

CreateChatTokenCommandOutput for command's response shape.

see

config for IvschatClient's config shape.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly input

input: CreateChatTokenCommandInput

Readonly middlewareStack

middlewareStack: IMiddlewareStack<CreateChatTokenCommandInput, CreateChatTokenCommandOutput>

Methods

Static getEndpointParameterInstructions