One KV store. One deploy. A website, SMS concierge, voice AI, and sponsor report — all in sync.
Intro Hook
Imagine deploying a full event experience — landing page, AI concierge, voice assistant, lead capture, feedback collection, and sponsor reporting — as a single Edge Compute function. No servers to manage. No tunnels. No drift between your website and your agents. That’s exactly what the edge-event-microsite sample demonstrates, using Telnyx’s AI Communications Infrastructure stack.
In this post, we’ll walk through how this sample works, the Telnyx products it leverages, and how you can build something similar for your next event, hackathon, or product launch.
What the App Does
The edge-event-microsite is a complete event experience built on Telnyx Edge Compute. Here’s what it does:
- Server-rendered microsite — Serves event details, schedule, and sponsor info directly from Telnyx KV.
- SMS/WhatsApp concierge — An AI-powered chatbot that answers attendee questions, qualifies leads, and routes hot leads to a sales rep.
- In-browser voice AI — Attendees can talk to the concierge directly in the browser using WebRTC and
@telnyx/ai-agent-lib, no phone number required. - Feedback transcription — Spoken feedback is transcribed via Whisper and summarized using AI Inference.
- Sponsor report — A daily email report is sent to the organizer with lead counts, feedback summaries, and engagement metrics.
All of this runs from a single Edge Compute function deployed at *.telnyxcompute.com, with one Telnyx KV namespace as the single source of truth.
How It Works
Architecture Overview
Attendee Browser ──► Edge Function ──► KV Namespace
SMS/WhatsApp ──► Edge Function ──► KV Namespace
Voice AI ──► Edge Function ──► KV Namespace
Every consumer — the website, the SMS/WhatsApp concierge, and the voice assistant — reads from and writes to the same KV keys. This means when you update the event schedule, every surface reflects the change instantly. No caching layers, no sync jobs, no drift.
Key Telnyx Products Used
| Product | Usage |
|---|---|
| Edge Compute | Hosts the microsite, APIs, and webhooks as a single TypeScript function |
| KV | Single namespace storing event data, attendees, leads, feedback, and assistant ID |
| AI Inference | Zero-credential OpenAI-compatible API for concierge Q&A, lead extraction, and feedback summaries |
| Messaging (SMS/WhatsApp) | Concierge replies, schedule broadcasts, and hot-lead routing |
| Voice AI | In-browser WebRTC voice agent using @telnyx/ai-agent-lib |
| Speech-to-Text | Whisper-based transcription of spoken feedback |
| Automated sponsor reports sent via Telnyx Email | |
| Webhook Security | Ed25519 signature verification for all inbound webhooks |
Code Highlights
Serving the Microsite from KV
export default {
async fetch(request: Request, env: Env) {
const url = new URL(request.url);
if (url.pathname === '/') {
const eventData = await env.EVENTS.get('event/data', 'json');
const html = renderMicrosite(eventData);
return new Response(html, { headers: { 'content-type': 'text/html' } });
}
if (url.pathname === '/api/schedule') {
const schedule = await env.EVENTS.get('event/schedule', 'json');
return new Response(JSON.stringify(schedule), {
headers: { 'content-type': 'application/json' }
});
}
// ... more routes
}
}
AI Concierge with Zero-Credential Inference
async function handleConciergeMessage(message: string, env: Env) {
const response = await env.TELNYX.ai.openai.chat.createCompletion({
model: env.AI_MODEL,
messages: [
{ role: 'system', content: 'You are a helpful event concierge.' },
{ role: 'user', content: message }
]
});
return response.choices[0].message.content;
}
Lead Qualification and Hot-Lead Routing
async function qualifyLead(leadData: any, env: Env) {
const summary = await env.TELNYX.ai.openai.chat.createCompletion({
model: env.AI_MODEL,
messages: [
{ role: 'system', content: 'Extract company, role, and interest level from this lead info.' },
{ role: 'user', content: JSON.stringify(leadData) }
]
});
const extracted = JSON.parse(summary.choices[0].message.content);
await env.EVENTS.put(`lead/${leadData.id}`, JSON.stringify(extracted));
// Route hot leads via SMS
if (extracted.interest_level === 'high') {
await sendSMS(env.TELNYX_SALES_REP_PHONE, `Hot lead: ${extracted.company} - ${extracted.role}`);
}
}
In-Browser Voice AI
The frontend uses @telnyx/ai-agent-lib to connect to a Telnyx AI Assistant provisioned via the Edge Function:
import { TelnyxVoiceAgent } from '@telnyx/ai-agent-lib';
const agent = new TelnyxVoiceAgent({
logLevel: 'debug',
// Anonymous login — no credentials needed
});
agent.connect();
The assistant is provisioned server-side and wired with a webhook tool that queries KV:
async function provisionAssistant(env: Env) {
const assistant = await fetch('https://api.telnyx.com/v2/ai/assistants', {
method: 'POST',
headers: { 'Authorization': `Bearer ${env.TELNYX_API_KEY}` },
body: JSON.stringify({
name: 'Event Concierge',
model: env.ASSISTANT_MODEL,
tools: [{
type: 'function',
function: {
name: 'lookup_event_info',
description: 'Look up event information from the KV store',
callback_url: 'https://<your-func>.telnyxcompute.com/tools/lookup'
}
}]
})
});
const assistantId = (await assistant.json()).data.id;
await env.EVENTS.put('assistant/id', assistantId);
}
Setup
Getting started is straightforward:
# Clone and install
git clone https://github.com/team-telnyx/telnyx-code-examples.git
cd telnyx-code-examples/edge-event-microsite
npm install
# Authenticate
telnyx-edge auth api-key set <YOUR_TELNYX_API_KEY>
# Create KV namespace
telnyx-edge storage kv create --name edge-event-microsite-data
# Add webhook verification secret
PUBLIC_KEY=$(curl -s -H "Authorization: Bearer $TELNYX_API_KEY" \
https://api.telnyx.com/v2/public_key | jq -r '.data.public')
telnyx-edge secrets add TELNYX_PUBLIC_KEY "$PUBLIC_KEY"
# Deploy
telnyx-edge ship
Conclusion
The edge-event-microsite sample shows how Telnyx’s AI Communications Infrastructure can power a complete, real-time event experience from a single edge function. By unifying KV, Messaging, Voice AI, and AI Inference under one deploy, you eliminate the complexity of coordinating multiple services — and the risk of data drift between them.
Whether you’re running a conference, a product launch, or a hackathon, this pattern gives you a blueprint for building responsive, intelligent, and fully integrated experiences at the edge.
Try it yourself: https://github.com/team-telnyx/telnyx-code-examples/tree/main/edge-event-microsite
---