@synapta/channels-sdk
v2.8.0
Published
Plugin contract for Synapta channel adapters (Telegram, Discord, Slack, etc.)
Downloads
184
Readme
@synapta/channels-sdk
Plugin contract for Synapta channel adapters (Telegram, Discord, Slack, email, etc.).
import { defineChannel } from '@synapta/channels-sdk';
export default defineChannel<{ botToken: string; allowedUserIds: number[] }>({
name: 'my-discord-channel',
version: '0.1.0',
create(opts) {
return {
name: 'my-discord-channel',
version: '0.1.0',
async init({ bridge }) {
/* open socket, subscribe to messages */
},
async shutdown() {
/* close socket */
},
async notifyApproval(req) {
/* push to allowlisted Discord channels */
},
};
},
});@synapta/telegram is the reference implementation. The host (daemon / gateway) instantiates plugins at startup based on the channels array in ~/.synapta/config.yaml.
