Astro SSE Chatbot
Streaming chat using Astro Islands architecture + Server-Sent Events. SEO-friendly, performance-first, easy to develop.
Chat Demo
Chat
Features
- SSE Streaming: Faster first token and typewriter experience
- Separation of concerns: React component as frontend island, loaded only when needed
- SEO-friendly: Meta, OG/Twitter, sitemap, robots.txt and JSON-LD
- Secure: API Key used only server-side
FAQ
Why use SSE instead of WebSocket?
SSE is sufficient for one-way streaming from server to client, simple to deploy, good compatibility, and suitable for generative model response streams.
How to switch models or add system prompts?
Pass 'model' and 'messages' (including system role) in the /api/chat endpoint.