@contractspec/bundle.library 2.9.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/.turbo/turbo-build.log +129 -115
  2. package/CHANGELOG.md +38 -0
  3. package/dist/components/docs/DocsIndexPage.js +1 -1
  4. package/dist/components/docs/architecture/ArchitectureControlPlanePage.d.ts +1 -0
  5. package/dist/components/docs/architecture/ArchitectureControlPlanePage.js +204 -0
  6. package/dist/components/docs/architecture/ArchitectureOverviewPage.js +17 -1
  7. package/dist/components/docs/architecture/index.d.ts +1 -0
  8. package/dist/components/docs/architecture/index.js +507 -289
  9. package/dist/components/docs/ecosystem/IntegrationsPage.js +6 -3
  10. package/dist/components/docs/ecosystem/PluginsPage.js +98 -98
  11. package/dist/components/docs/ecosystem/RegistryPage.js +39 -42
  12. package/dist/components/docs/ecosystem/TemplatesPage.js +26 -21
  13. package/dist/components/docs/ecosystem/ecosystem.docblocks.js +10 -10
  14. package/dist/components/docs/ecosystem/index.js +179 -174
  15. package/dist/components/docs/index.js +6795 -5376
  16. package/dist/components/docs/integrations/IntegrationsElevenLabsPage.js +2 -2
  17. package/dist/components/docs/integrations/IntegrationsGithubPage.d.ts +1 -0
  18. package/dist/components/docs/integrations/IntegrationsGithubPage.js +155 -0
  19. package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.d.ts +1 -0
  20. package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.js +168 -0
  21. package/dist/components/docs/integrations/IntegrationsMistralPage.d.ts +1 -0
  22. package/dist/components/docs/integrations/IntegrationsMistralPage.js +203 -0
  23. package/dist/components/docs/integrations/IntegrationsOpenAIPage.js +2 -2
  24. package/dist/components/docs/integrations/IntegrationsOverviewPage.js +136 -9
  25. package/dist/components/docs/integrations/IntegrationsSlackPage.d.ts +1 -0
  26. package/dist/components/docs/integrations/IntegrationsSlackPage.js +161 -0
  27. package/dist/components/docs/integrations/IntegrationsSpecModelPage.js +72 -0
  28. package/dist/components/docs/integrations/IntegrationsTwilioPage.js +2 -2
  29. package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.d.ts +1 -0
  30. package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js +157 -0
  31. package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.d.ts +1 -0
  32. package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +165 -0
  33. package/dist/components/docs/integrations/index.d.ts +6 -0
  34. package/dist/components/docs/integrations/index.js +1688 -492
  35. package/dist/index.js +8016 -6597
  36. package/dist/node/components/docs/DocsIndexPage.js +1 -1
  37. package/dist/node/components/docs/architecture/ArchitectureControlPlanePage.js +203 -0
  38. package/dist/node/components/docs/architecture/ArchitectureOverviewPage.js +17 -1
  39. package/dist/node/components/docs/architecture/index.js +507 -289
  40. package/dist/node/components/docs/ecosystem/IntegrationsPage.js +6 -3
  41. package/dist/node/components/docs/ecosystem/PluginsPage.js +98 -98
  42. package/dist/node/components/docs/ecosystem/RegistryPage.js +39 -42
  43. package/dist/node/components/docs/ecosystem/TemplatesPage.js +26 -21
  44. package/dist/node/components/docs/ecosystem/ecosystem.docblocks.js +10 -10
  45. package/dist/node/components/docs/ecosystem/index.js +179 -174
  46. package/dist/node/components/docs/index.js +6795 -5376
  47. package/dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js +2 -2
  48. package/dist/node/components/docs/integrations/IntegrationsGithubPage.js +154 -0
  49. package/dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js +167 -0
  50. package/dist/node/components/docs/integrations/IntegrationsMistralPage.js +202 -0
  51. package/dist/node/components/docs/integrations/IntegrationsOpenAIPage.js +2 -2
  52. package/dist/node/components/docs/integrations/IntegrationsOverviewPage.js +136 -9
  53. package/dist/node/components/docs/integrations/IntegrationsSlackPage.js +160 -0
  54. package/dist/node/components/docs/integrations/IntegrationsSpecModelPage.js +72 -0
  55. package/dist/node/components/docs/integrations/IntegrationsTwilioPage.js +2 -2
  56. package/dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js +156 -0
  57. package/dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +164 -0
  58. package/dist/node/components/docs/integrations/index.js +1688 -492
  59. package/dist/node/index.js +8016 -6597
  60. package/package.json +104 -20
  61. package/src/components/docs/DocsIndexPage.tsx +2 -1
  62. package/src/components/docs/architecture/ArchitectureControlPlanePage.tsx +136 -0
  63. package/src/components/docs/architecture/ArchitectureOverviewPage.tsx +13 -1
  64. package/src/components/docs/architecture/index.ts +1 -0
  65. package/src/components/docs/ecosystem/IntegrationsPage.tsx +4 -3
  66. package/src/components/docs/ecosystem/PluginsPage.tsx +68 -87
  67. package/src/components/docs/ecosystem/RegistryPage.tsx +35 -43
  68. package/src/components/docs/ecosystem/TemplatesPage.tsx +28 -21
  69. package/src/components/docs/ecosystem/ecosystem.docblocks.ts +12 -10
  70. package/src/components/docs/generated/docs-index._common.json +240 -0
  71. package/src/components/docs/generated/docs-index.health.json +98 -0
  72. package/src/components/docs/generated/docs-index.manifest.json +14 -4
  73. package/src/components/docs/generated/docs-index.platform-integrations.json +81 -1
  74. package/src/components/docs/generated/docs-index.video-api-showcase.json +26 -0
  75. package/src/components/docs/integrations/IntegrationsElevenLabsPage.tsx +2 -2
  76. package/src/components/docs/integrations/IntegrationsGithubPage.tsx +90 -0
  77. package/src/components/docs/integrations/IntegrationsHealthRoutingPage.tsx +112 -0
  78. package/src/components/docs/integrations/IntegrationsMistralPage.tsx +133 -0
  79. package/src/components/docs/integrations/IntegrationsOpenAIPage.tsx +2 -2
  80. package/src/components/docs/integrations/IntegrationsOverviewPage.tsx +108 -9
  81. package/src/components/docs/integrations/IntegrationsSlackPage.tsx +98 -0
  82. package/src/components/docs/integrations/IntegrationsSpecModelPage.tsx +59 -0
  83. package/src/components/docs/integrations/IntegrationsTwilioPage.tsx +2 -2
  84. package/src/components/docs/integrations/IntegrationsWhatsappMetaPage.tsx +90 -0
  85. package/src/components/docs/integrations/IntegrationsWhatsappTwilioPage.tsx +92 -0
  86. package/src/components/docs/integrations/index.ts +6 -0
@@ -77,15 +77,22 @@ export function IntegrationsOverviewPage() {
77
77
  <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
78
78
  <pre>{`type IntegrationCategory =
79
79
  | "payments" // Stripe
80
+ | "open-banking" // Powens
80
81
  | "email" // Postmark, Resend, Gmail
81
82
  | "calendar" // Google Calendar
82
83
  | "sms" // Twilio
83
- | "ai-llm" // OpenAI
84
- | "ai-voice" // ElevenLabs
85
- | "speech-to-text" // OpenAI Whisper
84
+ | "messaging" // Slack, GitHub, WhatsApp
85
+ | "health" // Whoop, Oura, Strava, Fitbit
86
+ | "ai-llm" // OpenAI, Mistral
87
+ | "ai-voice-tts" // ElevenLabs
88
+ | "ai-voice-stt" // OpenAI Whisper, Mistral Voxtral
89
+ | "ai-voice-conversational" // OpenAI Realtime, Mistral Voice
90
+ | "ai-image" // OpenAI Image, Fal
86
91
  | "vector-db" // Qdrant
92
+ | "database" // Supabase Postgres
87
93
  | "storage" // S3-compatible
88
- | "open-banking" // Powens (read-only)
94
+ | "meeting-recorder" // Fireflies, tl;dv
95
+ | "project-management" // Linear, Jira, Notion
89
96
  | "accounting" // Coming soon
90
97
  | "crm" // Coming soon
91
98
  | "helpdesk" // Coming soon
@@ -206,6 +213,17 @@ export function IntegrationsOverviewPage() {
206
213
  LLMs, embeddings, and Whisper speech-to-text
207
214
  </p>
208
215
  </Link>
216
+ <Link
217
+ href="/docs/integrations/mistral"
218
+ className="card-subtle group p-4 transition-colors hover:border-violet-500/50"
219
+ >
220
+ <h4 className="font-bold transition-colors group-hover:text-violet-400">
221
+ Mistral
222
+ </h4>
223
+ <p className="text-muted-foreground mt-1 text-sm">
224
+ LLMs, embeddings, Voxtral STT, and conversational voice
225
+ </p>
226
+ </Link>
209
227
  <Link
210
228
  href="/docs/integrations/elevenlabs"
211
229
  className="card-subtle group p-4 transition-colors hover:border-violet-500/50"
@@ -251,7 +269,7 @@ export function IntegrationsOverviewPage() {
251
269
 
252
270
  {/* SMS */}
253
271
  <div className="space-y-3">
254
- <h3 className="text-xl font-semibold">SMS & Messaging</h3>
272
+ <h3 className="text-xl font-semibold">SMS</h3>
255
273
  <div className="grid gap-4 md:grid-cols-2">
256
274
  <Link
257
275
  href="/docs/integrations/twilio"
@@ -261,7 +279,78 @@ export function IntegrationsOverviewPage() {
261
279
  Twilio
262
280
  </h4>
263
281
  <p className="text-muted-foreground mt-1 text-sm">
264
- SMS notifications and messaging
282
+ SMS notifications and transactional messaging
283
+ </p>
284
+ </Link>
285
+ </div>
286
+ </div>
287
+
288
+ {/* Messaging channels */}
289
+ <div className="space-y-3">
290
+ <h3 className="text-xl font-semibold">Messaging channels</h3>
291
+ <div className="grid gap-4 md:grid-cols-2">
292
+ <Link
293
+ href="/docs/integrations/slack"
294
+ className="card-subtle group p-4 transition-colors hover:border-violet-500/50"
295
+ >
296
+ <h4 className="font-bold transition-colors group-hover:text-violet-400">
297
+ Slack
298
+ </h4>
299
+ <p className="text-muted-foreground mt-1 text-sm">
300
+ Signed event ingestion and outbox-backed replies
301
+ </p>
302
+ </Link>
303
+ <Link
304
+ href="/docs/integrations/github"
305
+ className="card-subtle group p-4 transition-colors hover:border-violet-500/50"
306
+ >
307
+ <h4 className="font-bold transition-colors group-hover:text-violet-400">
308
+ GitHub
309
+ </h4>
310
+ <p className="text-muted-foreground mt-1 text-sm">
311
+ Issue and PR comment workflows with webhook verification
312
+ </p>
313
+ </Link>
314
+ <Link
315
+ href="/docs/integrations/whatsapp-meta"
316
+ className="card-subtle group p-4 transition-colors hover:border-violet-500/50"
317
+ >
318
+ <h4 className="font-bold transition-colors group-hover:text-violet-400">
319
+ WhatsApp Meta
320
+ </h4>
321
+ <p className="text-muted-foreground mt-1 text-sm">
322
+ Primary WhatsApp Business API transport for inbound and
323
+ outbound
324
+ </p>
325
+ </Link>
326
+ <Link
327
+ href="/docs/integrations/whatsapp-twilio"
328
+ className="card-subtle group p-4 transition-colors hover:border-violet-500/50"
329
+ >
330
+ <h4 className="font-bold transition-colors group-hover:text-violet-400">
331
+ WhatsApp Twilio
332
+ </h4>
333
+ <p className="text-muted-foreground mt-1 text-sm">
334
+ Fallback WhatsApp route with Twilio signature validation
335
+ </p>
336
+ </Link>
337
+ </div>
338
+ </div>
339
+
340
+ {/* Health */}
341
+ <div className="space-y-3">
342
+ <h3 className="text-xl font-semibold">Health & wearables</h3>
343
+ <div className="grid gap-4 md:grid-cols-2">
344
+ <Link
345
+ href="/docs/integrations/health-routing"
346
+ className="card-subtle group p-4 transition-colors hover:border-violet-500/50"
347
+ >
348
+ <h4 className="font-bold transition-colors group-hover:text-violet-400">
349
+ Health routing strategy
350
+ </h4>
351
+ <p className="text-muted-foreground mt-1 text-sm">
352
+ Official vs aggregator transport order, unofficial gating, and
353
+ OAuth refresh config
265
354
  </p>
266
355
  </Link>
267
356
  </div>
@@ -372,6 +461,8 @@ POSTMARK_FROM_EMAIL=noreply@example.com
372
461
  OPENAI_API_KEY=sk-...
373
462
  OPENAI_ORGANIZATION=org-...
374
463
 
464
+ MISTRAL_API_KEY=...
465
+
375
466
  QDRANT_URL=https://...
376
467
  QDRANT_API_KEY=...
377
468
 
@@ -395,14 +486,22 @@ STRIPE_SECRET_OVERRIDE=env://STRIPE_SECRET_KEY`}</pre>
395
486
  <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
396
487
  <pre>{`type IntegrationCategory =
397
488
  | "payments" // Stripe, PayPal, etc.
489
+ | "open-banking" // Powens and open banking providers
398
490
  | "email" // Postmark, Resend, Gmail
399
491
  | "calendar" // Google Calendar, Outlook
400
492
  | "sms" // Twilio, MessageBird
401
- | "ai-llm" // OpenAI, Anthropic, Cohere
402
- | "ai-voice" // ElevenLabs, Google TTS
403
- | "speech-to-text" // OpenAI Whisper, Google STT
493
+ | "messaging" // Slack, GitHub, WhatsApp
494
+ | "health" // Whoop, Oura, Strava, Fitbit
495
+ | "ai-llm" // OpenAI, Anthropic, Cohere, Mistral
496
+ | "ai-voice-tts" // ElevenLabs, Google TTS
497
+ | "ai-voice-stt" // OpenAI Whisper, Google STT, Mistral Voxtral
498
+ | "ai-voice-conversational" // OpenAI Realtime, Mistral Voice
499
+ | "ai-image" // OpenAI Image, Fal
404
500
  | "vector-db" // Qdrant, Pinecone, Weaviate
501
+ | "database" // Supabase, Postgres
405
502
  | "storage" // S3, GCS, Azure Blob
503
+ | "meeting-recorder" // Fireflies, tl;dv, Granola
504
+ | "project-management" // Linear, Jira, Notion
406
505
  | "accounting" // QuickBooks, Xero (coming soon)
407
506
  | "crm" // Salesforce, HubSpot (coming soon)
408
507
  | "helpdesk" // Zendesk, Intercom (coming soon)
@@ -0,0 +1,98 @@
1
+ import Link from '@contractspec/lib.ui-link';
2
+ import { ChevronRight } from 'lucide-react';
3
+
4
+ export function IntegrationsSlackPage() {
5
+ return (
6
+ <div className="space-y-8">
7
+ <div className="space-y-4">
8
+ <h1 className="text-4xl font-bold">Slack Messaging</h1>
9
+ <p className="text-muted-foreground">
10
+ ContractSpec supports signed Slack event ingestion and outbox-backed
11
+ outbound replies through the channel runtime.
12
+ </p>
13
+ </div>
14
+
15
+ <div className="space-y-4">
16
+ <h2 className="text-2xl font-bold">Required secrets and config</h2>
17
+ <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
18
+ <pre>{`// secret payload
19
+ {
20
+ "botToken": "xoxb-...",
21
+ "signingSecret": "..."
22
+ }
23
+
24
+ // optional connection config
25
+ {
26
+ "defaultChannelId": "C0123456789",
27
+ "apiBaseUrl": "https://slack.com/api"
28
+ }`}</pre>
29
+ </div>
30
+ </div>
31
+
32
+ <div className="space-y-4">
33
+ <h2 className="text-2xl font-bold">Webhook ingress</h2>
34
+ <ul className="text-muted-foreground list-inside list-disc space-y-2">
35
+ <li>
36
+ Inbound events are accepted on{' '}
37
+ <code className="bg-background/50 rounded px-2 py-1">
38
+ /webhooks/slack/events
39
+ </code>
40
+ .
41
+ </li>
42
+ <li>
43
+ Requests are validated with Slack signatures (
44
+ <code className="bg-background/50 rounded px-2 py-1">
45
+ x-slack-signature
46
+ </code>{' '}
47
+ + timestamp tolerance).
48
+ </li>
49
+ <li>
50
+ Normalized events are deduplicated and persisted before any outbound
51
+ side effects.
52
+ </li>
53
+ </ul>
54
+ </div>
55
+
56
+ <div className="space-y-4">
57
+ <h2 className="text-2xl font-bold">Workspace routing and dispatch</h2>
58
+ <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
59
+ <pre>{`# Workspace mapping (recommended)
60
+ CHANNEL_WORKSPACE_MAP_SLACK={"T123":"workspace-acme"}
61
+
62
+ # Dispatch protection
63
+ CHANNEL_DISPATCH_TOKEN=...
64
+
65
+ # Optional scheduler
66
+ CHANNEL_DISPATCH_INTERVAL_MS=120000
67
+ CHANNEL_DISPATCH_RUN_ON_START=1`}</pre>
68
+ </div>
69
+ </div>
70
+
71
+ <div className="space-y-4">
72
+ <h2 className="text-2xl font-bold">Best practices</h2>
73
+ <ul className="text-muted-foreground list-inside list-disc space-y-2">
74
+ <li>
75
+ Keep bot tokens and signing secrets in a managed secret provider.
76
+ </li>
77
+ <li>Use workspace mapping to prevent cross-tenant event leakage.</li>
78
+ <li>
79
+ Keep dispatch asynchronous so webhook handlers stay fast and
80
+ reliable.
81
+ </li>
82
+ <li>
83
+ Monitor telemetry for ingest, decision, outbox, and dispatch stages.
84
+ </li>
85
+ </ul>
86
+ </div>
87
+
88
+ <div className="flex items-center gap-4 pt-4">
89
+ <Link href="/docs/integrations/twilio" className="btn-ghost">
90
+ Previous: Twilio SMS
91
+ </Link>
92
+ <Link href="/docs/integrations/github" className="btn-primary">
93
+ Next: GitHub Messaging <ChevronRight size={16} />
94
+ </Link>
95
+ </div>
96
+ </div>
97
+ );
98
+ }
@@ -234,6 +234,65 @@ export function IntegrationsSpecModelPage() {
234
234
  </div>
235
235
  </div>
236
236
 
237
+ <div className="space-y-4">
238
+ <h2 className="text-2xl font-bold">
239
+ Example: Messaging IntegrationConnection
240
+ </h2>
241
+ <p className="text-muted-foreground">
242
+ Messaging providers use the same spec + connection model, then route
243
+ inbound events through the channel runtime for signature validation,
244
+ idempotent ingestion, policy decisions, and outbox-backed dispatch.
245
+ </p>
246
+ <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
247
+ <pre>{`{
248
+ id: "conn_slack_acme_prod",
249
+ tenantId: "acme-corp",
250
+ integrationId: "messaging.slack",
251
+ environment: "production",
252
+ config: {
253
+ defaultChannelId: "C0123456789",
254
+ apiBaseUrl: "https://slack.com/api"
255
+ },
256
+ secretRef: "secret_slack_acme_prod_v1",
257
+ status: "connected"
258
+ }
259
+
260
+ // secret payload behind secretRef
261
+ {
262
+ "botToken": "xoxb-...",
263
+ "signingSecret": "..."
264
+ }`}</pre>
265
+ </div>
266
+ </div>
267
+
268
+ <div className="space-y-4">
269
+ <h2 className="text-2xl font-bold">Health transport strategy config</h2>
270
+ <p className="text-muted-foreground">
271
+ Health providers support deterministic transport routing and explicit
272
+ unofficial gating in connection config.
273
+ </p>
274
+ <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
275
+ <pre>{`{
276
+ "defaultTransport": "official-api",
277
+ "strategyOrder": ["official-api", "aggregator-api", "unofficial"],
278
+ "allowUnofficial": false,
279
+ "unofficialAllowList": ["health.peloton"],
280
+ "mcpUrl": "https://mcp.provider.example",
281
+ "oauthTokenUrl": "https://api.provider.example/oauth/token"
282
+ }
283
+
284
+ // secret payload behind secretRef
285
+ {
286
+ "accessToken": "...",
287
+ "refreshToken": "...",
288
+ "clientId": "...",
289
+ "clientSecret": "...",
290
+ "tokenExpiresAt": "2026-02-01T00:00:00.000Z",
291
+ "mcpAccessToken": "..."
292
+ }`}</pre>
293
+ </div>
294
+ </div>
295
+
237
296
  <div className="space-y-4">
238
297
  <h2 className="text-2xl font-bold">Health checks</h2>
239
298
  <p className="text-muted-foreground">
@@ -76,8 +76,8 @@ outputs:
76
76
  <Link href="/docs/integrations/s3" className="btn-ghost">
77
77
  Previous: S3 Storage
78
78
  </Link>
79
- <Link href="/docs/integrations" className="btn-primary">
80
- Back to Integrations
79
+ <Link href="/docs/integrations/slack" className="btn-primary">
80
+ Next: Slack Messaging
81
81
  </Link>
82
82
  </div>
83
83
  </div>
@@ -0,0 +1,90 @@
1
+ import Link from '@contractspec/lib.ui-link';
2
+ import { ChevronRight } from 'lucide-react';
3
+
4
+ export function IntegrationsWhatsappMetaPage() {
5
+ return (
6
+ <div className="space-y-8">
7
+ <div className="space-y-4">
8
+ <h1 className="text-4xl font-bold">WhatsApp Meta</h1>
9
+ <p className="text-muted-foreground">
10
+ Meta WhatsApp is the primary WhatsApp channel for ContractSpec's
11
+ messaging runtime, with signed webhook verification and reliable
12
+ outbound delivery.
13
+ </p>
14
+ </div>
15
+
16
+ <div className="space-y-4">
17
+ <h2 className="text-2xl font-bold">Required secrets and config</h2>
18
+ <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
19
+ <pre>{`// secret payload
20
+ {
21
+ "accessToken": "...",
22
+ "appSecret": "...",
23
+ "verifyToken": "..."
24
+ }
25
+
26
+ // required connection config
27
+ {
28
+ "phoneNumberId": "120000000001",
29
+ "apiVersion": "v22.0"
30
+ }`}</pre>
31
+ </div>
32
+ </div>
33
+
34
+ <div className="space-y-4">
35
+ <h2 className="text-2xl font-bold">Webhook endpoints</h2>
36
+ <ul className="text-muted-foreground list-inside list-disc space-y-2">
37
+ <li>
38
+ Verification challenge:{' '}
39
+ <code className="bg-background/50 rounded px-2 py-1">
40
+ GET /webhooks/whatsapp/meta
41
+ </code>
42
+ </li>
43
+ <li>
44
+ Inbound messages:{' '}
45
+ <code className="bg-background/50 rounded px-2 py-1">
46
+ POST /webhooks/whatsapp/meta
47
+ </code>
48
+ </li>
49
+ <li>
50
+ Signatures are validated with{' '}
51
+ <code className="bg-background/50 rounded px-2 py-1">
52
+ x-hub-signature-256
53
+ </code>
54
+ .
55
+ </li>
56
+ </ul>
57
+ </div>
58
+
59
+ <div className="space-y-4">
60
+ <h2 className="text-2xl font-bold">Workspace mapping</h2>
61
+ <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
62
+ <pre>{`CHANNEL_WORKSPACE_MAP_WHATSAPP_META={"120000000001":"workspace-acme"}`}</pre>
63
+ </div>
64
+ </div>
65
+
66
+ <div className="space-y-4">
67
+ <h2 className="text-2xl font-bold">Best practices</h2>
68
+ <ul className="text-muted-foreground list-inside list-disc space-y-2">
69
+ <li>Keep verify and app secrets separate from access tokens.</li>
70
+ <li>
71
+ Map each phone number ID to a workspace for strict tenant routing.
72
+ </li>
73
+ <li>
74
+ Use Twilio WhatsApp only as fallback when you need active-passive
75
+ routing.
76
+ </li>
77
+ </ul>
78
+ </div>
79
+
80
+ <div className="flex items-center gap-4 pt-4">
81
+ <Link href="/docs/integrations/github" className="btn-ghost">
82
+ Previous: GitHub Messaging
83
+ </Link>
84
+ <Link href="/docs/integrations/whatsapp-twilio" className="btn-primary">
85
+ Next: WhatsApp Twilio <ChevronRight size={16} />
86
+ </Link>
87
+ </div>
88
+ </div>
89
+ );
90
+ }
@@ -0,0 +1,92 @@
1
+ import Link from '@contractspec/lib.ui-link';
2
+ import { ChevronRight } from 'lucide-react';
3
+
4
+ export function IntegrationsWhatsappTwilioPage() {
5
+ return (
6
+ <div className="space-y-8">
7
+ <div className="space-y-4">
8
+ <h1 className="text-4xl font-bold">WhatsApp Twilio</h1>
9
+ <p className="text-muted-foreground">
10
+ Twilio WhatsApp support provides a durable fallback channel with
11
+ signature verification and outbox-backed outbound dispatch.
12
+ </p>
13
+ </div>
14
+
15
+ <div className="space-y-4">
16
+ <h2 className="text-2xl font-bold">Required secrets and config</h2>
17
+ <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
18
+ <pre>{`// secret payload
19
+ {
20
+ "accountSid": "AC123",
21
+ "authToken": "..."
22
+ }
23
+
24
+ // optional connection config
25
+ {
26
+ "fromNumber": "whatsapp:+15550002"
27
+ }`}</pre>
28
+ </div>
29
+ </div>
30
+
31
+ <div className="space-y-4">
32
+ <h2 className="text-2xl font-bold">Webhook ingress</h2>
33
+ <ul className="text-muted-foreground list-inside list-disc space-y-2">
34
+ <li>
35
+ Inbound Twilio form payloads are accepted on{' '}
36
+ <code className="bg-background/50 rounded px-2 py-1">
37
+ /webhooks/whatsapp/twilio
38
+ </code>
39
+ .
40
+ </li>
41
+ <li>
42
+ Signatures are validated with{' '}
43
+ <code className="bg-background/50 rounded px-2 py-1">
44
+ x-twilio-signature
45
+ </code>{' '}
46
+ and the configured auth token.
47
+ </li>
48
+ <li>
49
+ For deterministic verification, set the exact public webhook URL in{' '}
50
+ <code className="bg-background/50 rounded px-2 py-1">
51
+ WHATSAPP_TWILIO_WEBHOOK_URL
52
+ </code>
53
+ .
54
+ </li>
55
+ </ul>
56
+ </div>
57
+
58
+ <div className="space-y-4">
59
+ <h2 className="text-2xl font-bold">Workspace mapping</h2>
60
+ <div className="bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm">
61
+ <pre>{`CHANNEL_WORKSPACE_MAP_WHATSAPP_TWILIO={"AC123":"workspace-acme"}`}</pre>
62
+ </div>
63
+ </div>
64
+
65
+ <div className="space-y-4">
66
+ <h2 className="text-2xl font-bold">Best practices</h2>
67
+ <ul className="text-muted-foreground list-inside list-disc space-y-2">
68
+ <li>
69
+ Use Twilio as fallback when Meta WhatsApp is your primary route.
70
+ </li>
71
+ <li>Keep account SID mapping explicit to avoid tenant misrouting.</li>
72
+ <li>
73
+ Protect internal dispatch endpoints with
74
+ <code className="bg-background/50 ml-1 rounded px-2 py-1">
75
+ CHANNEL_DISPATCH_TOKEN
76
+ </code>
77
+ .
78
+ </li>
79
+ </ul>
80
+ </div>
81
+
82
+ <div className="flex items-center gap-4 pt-4">
83
+ <Link href="/docs/integrations/whatsapp-meta" className="btn-ghost">
84
+ Previous: WhatsApp Meta
85
+ </Link>
86
+ <Link href="/docs/integrations/health-routing" className="btn-primary">
87
+ Next: Health Routing <ChevronRight size={16} />
88
+ </Link>
89
+ </div>
90
+ </div>
91
+ );
92
+ }
@@ -1,14 +1,20 @@
1
1
  export { IntegrationsOverviewPage } from './IntegrationsOverviewPage';
2
2
  export { IntegrationsCircuitBreakersPage } from './IntegrationsCircuitBreakersPage';
3
3
  export { IntegrationsElevenLabsPage } from './IntegrationsElevenLabsPage';
4
+ export { IntegrationsGithubPage } from './IntegrationsGithubPage';
4
5
  export { IntegrationsGmailPage } from './IntegrationsGmailPage';
5
6
  export { IntegrationsGoogleCalendarPage } from './IntegrationsGoogleCalendarPage';
7
+ export { IntegrationsHealthRoutingPage } from './IntegrationsHealthRoutingPage';
8
+ export { IntegrationsMistralPage } from './IntegrationsMistralPage';
6
9
  export { IntegrationsOpenAIPage } from './IntegrationsOpenAIPage';
7
10
  export { IntegrationsPostmarkPage } from './IntegrationsPostmarkPage';
8
11
  export { IntegrationsPowensPage } from './IntegrationsPowensPage';
9
12
  export { IntegrationsQdrantPage } from './IntegrationsQdrantPage';
10
13
  export { IntegrationsResendPage } from './IntegrationsResendPage';
11
14
  export { IntegrationsS3Page } from './IntegrationsS3Page';
15
+ export { IntegrationsSlackPage } from './IntegrationsSlackPage';
12
16
  export { IntegrationsSpecModelPage } from './IntegrationsSpecModelPage';
13
17
  export { IntegrationsStripePage } from './IntegrationsStripePage';
14
18
  export { IntegrationsTwilioPage } from './IntegrationsTwilioPage';
19
+ export { IntegrationsWhatsappMetaPage } from './IntegrationsWhatsappMetaPage';
20
+ export { IntegrationsWhatsappTwilioPage } from './IntegrationsWhatsappTwilioPage';