Spanish Tutor · React (Vite)
This implementation is available in the repository. Fork it, run locally, and adapt the lesson UI around the same Liforma embed.
From the repo root, ./start runs all examples (or ./start sveltekit / ./start nextjs / ./start react-vite for those frameworks). To run only this one:
cd examples/spanish-tutor/react-vite
npm install
npm run dev
# http://localhost:4003 Local URL: http://localhost:4003
Each lesson has its own experienceId in src/lib/lessons.ts (SvelteKit) or lessons.js (vanilla). Every ID maps to a Liforma Experience with a different scenario,
location, and tutor prompt — for example café lessons use exp_T0I7ACMQLBMPG6K.
Mount <Experience /> from @liforma/client/react:
<script src="https://cdn.liforma.ai/sdk/v2/client.js"><\/script>
<!-- experience-id comes from the selected lesson / session config -->
<liforma-experience experience-id="${lesson.experienceId}"></liforma-experience> TutorApp.tsx — lesson UI, embed, and close-before-switch flowlib/lessons.ts — lesson data and per-lesson experienceIdUse the Liforma Spanish Tutor React (Vite) example as source material. Source repo folder: examples/spanish-tutor/react-vite Start from `TutorApp.tsx` — lesson selection + Experience mount rules. Preserve: - `<Experience />` from `@liforma/client/react` with `language="es"` - import from `@liforma/client/react` - close-before-switch: do not change `experienceId` while a session is mounted; unmount first - mount Experience only when the session is active - per-lesson `experienceId` in lesson data (not environment variables) - TypeScript and normal CSS (no Tailwind) Adapt: - branding - lesson content - experience IDs per lesson - surrounding product UI