Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Overview

This node integrates with the Stream Chat service to perform server-side operations related to chat users, channels, messages, and moderation. Specifically for the User - Generate Token operation, it creates an authentication token for a specified user ID. This token can be used by client applications to authenticate the user when connecting to Stream Chat.

Common scenarios where this node is beneficial include:

  • Generating user tokens dynamically during user login or registration flows.
  • Automating user management tasks in chat applications.
  • Integrating Stream Chat authentication into custom workflows without exposing secret keys on the client side.

Example:
You have a chat app where users log in via your system. When a user logs in, you use this node to generate a Stream Chat token for their user ID, which the frontend then uses to connect securely to the chat service.

Properties

Name Meaning
User ID A unique identifier for the user. Can be any string (e.g., "john_doe", "user123"). Required.

Output

The output JSON contains a single field:

  • token: A string representing the generated user token. This token authenticates the user with Stream Chat services.

No binary data is output by this operation.

Example output JSON:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Dependencies

  • Requires an API key credential configured in n8n that has permissions to interact with the Stream Chat server-side API.
  • The node internally uses a Stream Chat server client instance to perform operations.
  • No additional environment variables are explicitly required beyond the API credentials.

Troubleshooting

  • Error: Unsupported operation
    Occurs if the resource or operation parameters do not match supported values. Ensure the Resource is set to "User" and Operation to "Generate Token".

  • API Authentication Errors
    If the API key credential is missing or invalid, the node will fail. Verify that the Stream Chat API key credential is correctly configured and has necessary permissions.

  • Invalid User ID
    The user ID must be a non-empty string. Providing an empty or malformed user ID may cause errors.

  • JSON Parsing Errors
    Although not applicable for this operation, other operations expect valid JSON inputs. Make sure JSON fields are well-formed.

Links and References


If you need details on other operations or resources, feel free to ask!

Discussion