Socket
Book a DemoInstallSign in
Socket

chat

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chat

Unified chat abstraction for Slack, Teams, Google Chat, and Discord

latest
Source
npmnpm
Version
4.2.0
Version published
Weekly downloads
711
171.37%
Maintainers
2
Weekly downloads
 
Created
Source

chat

A unified SDK for building chat bots across Slack, Microsoft Teams, and Google Chat.

Installation

npm install chat

Quick Start

import { Chat, emoji } from "chat";
import { createSlackAdapter } from "@chat-adapter/slack";
import { createRedisState } from "@chat-adapter/state-redis";

const bot = new Chat({
  userName: "mybot",
  adapters: {
    slack: createSlackAdapter({
      botToken: process.env.SLACK_BOT_TOKEN!,
      signingSecret: process.env.SLACK_SIGNING_SECRET!,
    }),
  },
  state: createRedisState({ url: process.env.REDIS_URL! }),
});

// Handle @mentions
bot.onNewMention(async (thread) => {
  await thread.subscribe();
  await thread.post(`${emoji.wave} Hello! I'm listening.`);
});

// Handle follow-up messages
bot.onSubscribedMessage(async (thread, message) => {
  await thread.post(`You said: ${message.text}`);
});

Adapters

PackagePlatform
@chat-adapter/slackSlack
@chat-adapter/teamsMicrosoft Teams
@chat-adapter/gchatGoogle Chat

State Adapters

PackageBackend
@chat-adapter/state-redisRedis (production)
@chat-adapter/state-ioredisRedis via ioredis
@chat-adapter/state-memoryIn-memory (dev only)

Features

  • Multi-platform: Write once, deploy to Slack, Teams, and Google Chat
  • Thread subscriptions: Follow conversations after @mentions
  • Rich cards: JSX-based cards that convert to Block Kit, Adaptive Cards, etc.
  • Action callbacks: Handle button clicks across platforms
  • Reactions: Type-safe emoji with cross-platform normalization
  • File uploads: Send files with messages
  • Direct messages: Initiate DMs programmatically
  • Serverless-ready: Pluggable state backends for distributed deployments

Documentation

See the main repository for full documentation.

License

MIT

Keywords

chat

FAQs

Package last updated on 03 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts