@classflow-api/communication-client
v0.2.0
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-clientUpgrading from 0.1.x? Review the 0.2 migration guide.
Usage
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',
channels: ['email'],
recipient: { kind: 'account', value: 'acc_xyz' },
variables: { schoolName: 'ClassFlow High', parentName: '王女士', code: 'A1B2C3' },
});