-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeveloper-message.html
More file actions
181 lines (157 loc) · 10.1 KB
/
Copy pathdeveloper-message.html
File metadata and controls
181 lines (157 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Developer — Message — StartOne Docs</title>
<meta name="description" content="The StartOne multi-channel AI bot: eight messaging platforms, two markets, one codebase. Setup, channel guides, and deployment.">
<link rel="icon" type="image/svg+xml" href="img/mark.svg">
<link rel="icon" href="img/favicon.ico" sizes="any">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
<meta name="theme-color" content="#7069ff">
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div class="hwrap">
<a href="index.html" class="brand">
<img src="img/mark.svg" alt="">
<span>Start<span class="one">One</span><sup class="tm">™</sup><span class="docs"> docs</span></span>
</a>
<div class="hlinks">
<a href="https://startone.ai">Home</a>
<a href="https://github.com/startoneai/startone-community">GitHub</a>
<a href="https://startone.ai#pricing">Pricing</a>
</div>
</div>
</header>
<div class="shell">
<nav class="side">
<h4>Start here</h4>
<a href="index.html" >Overview</a>
<a href="index.html#which">Which edition?</a>
<h4>Community — free</h4>
<a href="community.html" >Quickstart</a>
<a href="community.html#config">Configuration</a>
<a href="community.html#limits">Limits</a>
<h4>Developer — Web</h4>
<a href="developer-web.html" >Quickstart</a>
<a href="developer-web.html#config">Configuration</a>
<a href="developer-web.html#architecture">Architecture</a>
<a href="developer-web.html#deploy">Deploying</a>
<h4>Developer — Message</h4>
<a href="developer-message.html" class="active">Quickstart</a>
<a href="developer-message.html#profile">Markets (US / CN)</a>
<a href="developer-message.html#channels">Channel setup</a>
<a href="developer-message.html#media">Media commands</a>
<a href="developer-message.html#deploy">Deploying</a>
<h4>Business</h4>
<a href="business.html" >Overview</a>
<h4>Reference</h4>
<a href="faq.html" >FAQ</a>
<a href="licensing.html" >Licensing</a>
</nav>
<main>
<span class="tag">$249 · Commercial license</span>
<h1>Developer — Message</h1>
<p class="lede">One AI bot, eight messaging platforms, two markets. Streaming chat with per-conversation memory, in-chat media generation, rate limiting — and a single environment variable to switch between the Western and Chinese channel sets.</p>
<h2>Requirements</h2>
<ul>
<li><strong>Node 22</strong> (the codebase targets Node 20.19+; 22 is what the repo pins)</li>
<li>An API key from at least one AI provider</li>
<li>Bot credentials for whichever channels you want to run</li>
<li><strong>Redis</strong> — optional. Without it, session memory falls back to in-process storage, which is lost on restart.</li>
</ul>
<h2>Quickstart</h2>
<pre><code>npm install
cp .env.example .env.local
npm run dev</code></pre>
<div class="note"><strong>It boots with nothing configured.</strong> With no keys and no bot tokens, every channel logs that it is not connecting and the bot runs in dry-run mode. Nothing crashes. Add credentials one channel at a time.</div>
<h2 id="profile">Markets — <code>PROFILE=us</code> or <code>PROFILE=cn</code></h2>
<p>This is the core design decision of the edition. <strong>One codebase serves both markets</strong>, and a single variable picks which channel set boots:</p>
<table>
<tr><th><code>PROFILE</code></th><th>Channels that start</th></tr>
<tr><td><code>us</code></td><td>Discord, Telegram, Slack, WhatsApp</td></tr>
<tr><td><code>cn</code></td><td>WeCom (企业微信), Feishu (飞书), DingTalk (钉钉), WeChat Official Accounts</td></tr>
</table>
<p>Channels outside the active profile are never initialised, so you do not need their credentials. Set <code>PROFILE</code> in <code>.env.local</code>.</p>
<h2>Configuration</h2>
<h3>Core</h3>
<table>
<tr><th>Variable</th><th>Purpose</th></tr>
<tr><td><code>PROFILE</code></td><td><code>us</code> or <code>cn</code> — which market's channels to run</td></tr>
<tr><td><code>AI_MODEL</code></td><td>Which chat model to use</td></tr>
<tr><td><code>SYSTEM_PROMPT</code></td><td>Override the bot's system prompt</td></tr>
<tr><td><code>BOT_PRESET</code></td><td>Load a preset persona (see <code>examples/presets.ts</code>)</td></tr>
<tr><td><code>REDIS_URL</code></td><td>Session memory and rate limiting. Optional; falls back to in-process.</td></tr>
</table>
<h3>AI providers</h3>
<table>
<tr><th>Variable</th><th>Enables</th></tr>
<tr><td><code>OPENAI_API_KEY</code></td><td>GPT models</td></tr>
<tr><td><code>ANTHROPIC_API_KEY</code></td><td>Claude models</td></tr>
<tr><td><code>GOOGLE_GENERATIVE_AI_API_KEY</code></td><td>Gemini models</td></tr>
<tr><td><code>ZAI_API_KEY</code></td><td>GLM models</td></tr>
</table>
<h3>Media</h3>
<table>
<tr><th>Variable</th><th>Purpose</th></tr>
<tr><td><code>FAL_KEY</code></td><td>fal.ai — image, video, speech</td></tr>
<tr><td><code>REPLICATE_API_TOKEN</code></td><td>Replicate — the alternate provider</td></tr>
<tr><td><code>MEDIA_PROVIDER</code></td><td><code>fal</code> (default) or <code>replicate</code></td></tr>
</table>
<h2 id="channels">Channel setup</h2>
<p>Each channel needs its own credentials from that platform's developer console. Set only the ones you intend to run. Per-channel walkthroughs ship in the repo under <code>docs/channels/</code>.</p>
<h3>Western channels (<code>PROFILE=us</code>)</h3>
<table>
<tr><th>Channel</th><th>Variables</th><th>Where to get them</th></tr>
<tr><td><strong>Discord</strong></td><td><code>DISCORD_BOT_TOKEN</code><br><code>DISCORD_APP_ID</code></td><td>Discord Developer Portal → your application</td></tr>
<tr><td><strong>Telegram</strong></td><td><code>TELEGRAM_BOT_TOKEN</code></td><td>Talk to @BotFather</td></tr>
<tr><td><strong>Slack</strong></td><td><code>SLACK_BOT_TOKEN</code><br><code>SLACK_APP_TOKEN</code></td><td>Slack API → your app (Socket Mode)</td></tr>
<tr><td><strong>WhatsApp</strong></td><td><code>WHATSAPP_ACCESS_TOKEN</code><br><code>WHATSAPP_PHONE_NUMBER_ID</code><br><code>WHATSAPP_VERIFY_TOKEN</code><br><code>WHATSAPP_APP_SECRET</code></td><td>Meta for Developers → WhatsApp Business API</td></tr>
</table>
<h3>Chinese channels (<code>PROFILE=cn</code>)</h3>
<table>
<tr><th>Channel</th><th>Variables</th><th>Where to get them</th></tr>
<tr><td><strong>WeCom</strong><br>企业微信</td><td><code>WECOM_CORP_ID</code><br><code>WECOM_CORP_SECRET</code><br><code>WECOM_AGENT_ID</code><br><code>WECOM_TOKEN</code><br><code>WECOM_ENCODING_AES_KEY</code></td><td>WeCom admin console → your app</td></tr>
<tr><td><strong>Feishu / Lark</strong><br>飞书</td><td><code>FEISHU_APP_ID</code><br><code>FEISHU_APP_SECRET</code><br><code>FEISHU_VERIFICATION_TOKEN</code></td><td>Feishu Open Platform</td></tr>
<tr><td><strong>DingTalk</strong><br>钉钉</td><td><code>DINGTALK_CLIENT_ID</code><br><code>DINGTALK_CLIENT_SECRET</code></td><td>DingTalk Open Platform</td></tr>
<tr><td><strong>WeChat OA</strong><br>微信公众号</td><td>Configured per the WeChat Official Account console</td><td>WeChat MP platform</td></tr>
</table>
<div class="note"><strong>WeCom uses encrypted callbacks.</strong> The <code>WECOM_TOKEN</code> and <code>WECOM_ENCODING_AES_KEY</code> pair drives message signature verification and AES decryption — both are required, and the implementation is in <code>src/adapters/wecom-crypto.ts</code>. This is the fiddliest of the eight; the walkthrough in <code>docs/channels/wecom.md</code> covers the callback URL setup step by step.</div>
<h3>Webhook vs. socket channels</h3>
<p>Discord, Telegram, and Slack connect outbound (long-poll or socket) and need no public URL. <strong>WhatsApp, WeCom, Feishu, DingTalk, and WeChat OA are webhook-based</strong> — the platform calls you, so they need a publicly reachable HTTPS endpoint. In local development, use a tunnel (ngrok, Cloudflare Tunnel) and register that URL in the platform's console.</p>
<h2 id="media">Media commands</h2>
<p>Media generation works in-chat, on every channel:</p>
<table>
<tr><th>Command</th><th>Produces</th></tr>
<tr><td><code>/imagine <prompt></code></td><td>An image</td></tr>
<tr><td><code>/video <prompt></code></td><td>A video</td></tr>
<tr><td><code>/speak <text></code></td><td>Speech audio</td></tr>
</table>
<p>Results are returned as native attachments where the platform supports it, and as links where it does not.</p>
<h2>Sessions and rate limiting</h2>
<p><strong>Session memory</strong> is per-conversation: the bot remembers context within a thread or DM. Backed by Redis when <code>REDIS_URL</code> is set; otherwise held in process and lost on restart.</p>
<p><strong>Rate limiting</strong> is applied per user to stop one person exhausting your API budget. Configure it in <code>src/core/rate-limit.ts</code>.</p>
<h2>Examples</h2>
<p>Runnable examples ship in <code>examples/</code>: a support bot, a daily digest bot, a media studio bot, and a community Q&A bot. Each is a working starting point rather than a snippet.</p>
<h2 id="deploy">Deploying</h2>
<p>Deploy configs are included for <strong>Fly</strong> (<code>fly.toml</code>) and <strong>Railway</strong> (<code>railway.json</code>), plus a <code>Dockerfile</code> for anywhere else.</p>
<pre><code>npm run build
npm start</code></pre>
<p><strong>In production you will want:</strong></p>
<ul>
<li>A managed Redis → <code>REDIS_URL</code>, so sessions survive restarts</li>
<li>A public HTTPS URL, if you run any webhook channel</li>
<li>The callback URL registered in each platform's console</li>
</ul>
<p>Full detail is in <code>docs/deploy.md</code> in the repo.</p>
<h2>What this edition does not include</h2>
<p><strong>No billing.</strong> Unmetered by design. To run a paid bot business — credits, payment rails, multi-tenancy — see <a href="business.html">Business</a>.</p>
<footer>
© 2026 Kredit Technology, LLC. StartOne™ is a trademark of Kredit Technology, LLC.
</footer>
</main>
</div>
</body>
</html>