Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Overview

The node performs server-side operations on Stream Chat channels, enabling management and interaction with chat channels programmatically. The "Hide" operation specifically allows hiding a channel from queries for a given user, optionally clearing the message history when hiding.

This is useful in scenarios where you want to programmatically hide certain channels from users' views without deleting them, such as archiving old conversations or managing visibility based on user preferences or moderation actions.

Example use cases:

  • A user wants to hide a group chat they no longer participate in.
  • An admin hides a channel from a specific user while optionally clearing the chat history for privacy.
  • Automating cleanup of inactive channels by hiding them from all members.

Properties

Name Meaning
Channel Type The type of the channel. Common options: "messaging" (1-on-1 chats), "team" (group channels), "livestream" (broadcast channels)
Channel ID Unique identifier for the channel (e.g., "general", "random", "team-alpha"). Combined with type to form CID. Required.
User ID The user ID for whom the channel will be hidden. Used for server-side operations.
Clear History Boolean flag indicating whether to clear the message history when hiding the channel. Default is false.

Output

The output JSON contains the response from the Stream Chat API for the hide operation. This typically includes confirmation of the hide action and any relevant metadata returned by the API.

No binary data is output by this operation.

Dependencies

  • Requires an API key credential for authenticating with the Stream Chat service.
  • The node uses the official Stream Chat server client library internally.
  • Proper permissions must be granted to the API key to perform channel hide operations.

Troubleshooting

  • Common issues:

    • Invalid or missing Channel ID or Channel Type can cause errors.
    • User ID not provided or incorrect may result in failure to hide the channel for the intended user.
    • Insufficient API permissions will cause authorization errors.
  • Error messages:

    • "Unsupported operation: channel.hide": Indicates the operation is not recognized; ensure correct resource and operation are selected.
    • API errors related to invalid parameters or authentication will be passed through; check credentials and input values.
  • Resolution tips:

    • Verify that Channel Type and Channel ID correspond to an existing channel.
    • Confirm the User ID is valid and exists in your Stream Chat application.
    • Ensure the API key used has the necessary permissions for channel management.
    • If clearing history is enabled, be aware this might affect message availability for the user.

Links and References

Discussion