Channels

Every option for the Telegram, Slack and WhatsApp channels in @intentface/latch-channels.

What channels are for: Channels. What they handle for you: Chat apps.

Each platform is a subpath, and each channel has one handleRequest(request) for its webhook route.

Telegram

ts
import { telegramChannel } from "@intentface/latch-channels/telegram";
OptionTypeDefaultDetails
agentstring—
botRefstring—
botTokenTelegramToken—
webhookSecretstring | (() => string | Promise<string>)—
runtimeChannelRunOps<P>—
authorizeUser(user: TelegramUser) => Promise<AuthResult<P>>—
seen?((deliveryKey: string) => Promise<boolean>)—
claimTurn?((chatId: string) => Promise<string | null>)—
releaseTurn?((chatId: string, token: string) => Promise<void>)—
stashPending?function—
authorizeUrl?function—
transcribe?TranscribeAudio—
askState?AskStateStore—
thread?ChannelThreadStore—
waitUntil?((p: Promise<unknown>) => void)—
apiOptions?TelegramApiOptions—

Slack

ts
import { slackChannel } from "@intentface/latch-channels/slack";
OptionTypeDefaultDetails
agentstring—
appIdstring—
principalP—
botTokenSlackToken—
runtimeChannelRunOps<P>—
botUserIdstring—
teamIdstring—
signingSecretstring | (() => string | Promise<string>)—
waitUntil?((p: Promise<unknown>) => void)—
claimOnce(key: string, ttlMs: number) => Promise<boolean>—
claimTurn?((chatId: string) => Promise<string | null>)—
releaseTurn?((chatId: string, token: string) => Promise<void>)—
threadsSlackThreadStore—
authorizeUser?function—
authorizeUrl?function—
onLifecycle?function—
onStreamMode?function—
apiOptions?SlackApiOptions—

WhatsApp

ts
import { whatsappChannel } from "@intentface/latch-channels/whatsapp";
OptionTypeDefaultDetails
agentstring—
botRefstring—
accessTokenLazyString—
phoneNumberIdLazyString—
appSecretLazyString—
verifyTokenLazyString—
runtimeChannelRunOps<P>—
authorizeUser(user: WhatsappUser) => Promise<AuthResult<P>>—
seen?((deliveryKey: string) => Promise<boolean>)—
claimTurn?((chatId: string) => Promise<string | null>)—
releaseTurn?((chatId: string, token: string) => Promise<void>)—
stashPending?function—
authorizeUrl?function—
askState?AskStateStore—
thread?ChannelThreadStore—
waitUntil?((p: Promise<unknown>) => void)—
apiOptions?WhatsappApiOptions—