feat: add react-tts-component demo - #23
Open
luke-speechify wants to merge 2 commits into
Open
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.app/api/speak/route.ts, soSPEECHIFY_API_KEYnever reaches the browser. Oneclient.audio.speech({ input, voice_id, audio_format, model })call (simba-3.2, MP3).Hosting + abuse protection
/react-tts-component(vercel.json+pnpm-workspace.yaml),basePathset, README table regenerated viapnpm generate./api/speakwith the shared Cloudflare Turnstile helper (app/lib/turnstile.ts, copied verbatim). Fail-opens whenTURNSTILE_SECRET_KEYis unset, so local dev and forks work with zero config.Verification
pnpm --filter react-tts-component build✅simba-3.2+geffen_32returns base64 MP3 + speech marks).Part of a batch getting the speechify.ai demo backlog ahead of schedule. Blog post is written separately.