@classflow-api/communication-client
v0.1.1
Published
Official TypeScript client for ClassFlow Communication — multi-channel message templates, dispatch and per-locale variables for the universal scheduling engine.
Readme
Install
npm install @classflow-api/communication-clientUsage
import { createHttpCommunicationClient } from '@classflow-api/communication-client';
const comm = createHttpCommunicationClient({
baseUrl: 'https://api.classflow.example',
sessionToken: 'eyJ...',
organizationId: 'org_123',
});
const tpl = await comm.templates.upsert({
key: 'invite.parent',
channel: 'email',
locale: 'zh-CN',
subject: '欢迎加入 {{schoolName}}',
body: '亲爱的{{parentName}},请使用以下邀请码 {{code}} 注册...',
});
await comm.dispatch.send({
templateKey: 'invite.parent',
channel: 'email',
recipient: { accountId: 'acc_xyz' },
variables: { schoolName: 'ClassFlow High', parentName: '王女士', code: 'A1B2C3' },
});