Skip to content

feat: add react-tts-component demo - #23

Open
luke-speechify wants to merge 2 commits into
mainfrom
feat/react-tts-component
Open

feat: add react-tts-component demo#23
luke-speechify wants to merge 2 commits into
mainfrom
feat/react-tts-component

Conversation

@luke-speechify

Copy link
Copy Markdown
Contributor

Pairs with the upcoming speechify.ai post "Adding a voice to a React app with the Speechify SDK."

What this demo is

A drop-in React component that adds a Speechify voice to any app — give it text, it speaks that text. The whole point is components/SpeechifyVoice.tsx: under 100 lines, copy it into your own app.

  • Server-side key — synthesis goes through app/api/speak/route.ts, so SPEECHIFY_API_KEY never reaches the browser. One client.audio.speech({ input, voice_id, audio_format, model }) call (simba-3.2, MP3).
  • Complements, doesn't repeat the existing Next.js cloning app / cloning blog post — this is the minimal "add a voice" component.

Hosting + abuse protection

  • Registered as a Vercel Service under /react-tts-component (vercel.json + pnpm-workspace.yaml), basePath set, README table regenerated via pnpm generate.
  • Gates /api/speak with the shared Cloudflare Turnstile helper (app/lib/turnstile.ts, copied verbatim). Fail-opens when TURNSTILE_SECRET_KEY is unset, so local dev and forks work with zero config.

Verification

  • pnpm --filter react-tts-component build
  • Live synthesis call against the API confirmed (simba-3.2 + geffen_32 returns base64 MP3 + speech marks).

Part of a batch getting the speechify.ai demo backlog ahead of schedule. Blog post is written separately.

A drop-in <100-line React component (SpeechifyVoice) that speaks any text
via the Speechify API, with the key held server-side in a route handler.
Hosted under /react-tts-component, gated with the shared Turnstile helper.
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
speechify-api-demos Ready Ready Preview Aug 21, 2026 12:10am

Request Review

…-API e2e

Apply the brand base tokens and pill buttons, add a mono eyebrow and
sentence-case heading. Fix the client to call the basePath-prefixed
/api/speak route so the Play button works under the demo mount. Add a
Playwright e2e that drives Play against the real Speechify API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant