Send a chat message with Thinwrap (TypeScript)
Post a chat message via the Thinwrap unified Chat facade in TypeScript — same call shape for Slack, Discord, Microsoft Teams, and every other supported chat provider.
1. Install
npm install @thinwrap/notifications2. Send the call
import { Chat } from '@thinwrap/notifications';
// Slack incoming-webhooks: the URL itself is both auth and channel routing.
const chat = new Chat('slack', {
webhookUrl: process.env.SLACK_WEBHOOK_URL!,
});
// `to` is omitted for webhook-routed providers (Slack, Discord, MS Teams,
// Mattermost, Google Chat) — the webhook URL already targets a channel.
const result = await chat.send({
body: 'Deploy finished — production is live.',
});
console.log(result.status, result.providerMessageId);
Same code works for all supported providers — just change the provider ID.