Cookies
You can read incoming cookies during SSR and write them back via Set-Cookie through the Mochi cookies API exposed on both server and client.
<script>
import CookieDemo from './CookieDemo.svelte';
const cuteNames = ['mochi_fan', 'bun_bun', 'pixel_panda', 'tiny_tanuki', 'cloud_kitten', 'waffle_fox', 'cocoa_bear', 'starry_otter', 'maple_duck', 'peach_pup'];
const randomCuteName = cuteNames[Math.floor(Math.random() * cuteNames.length)];
</script>
<CookieDemo defaultUsername={randomCuteName} mochi:hydrate />
More demos
Scheduled jobs with cron How scheduled jobs work — a Mochi.cron() job writes to an in-memory log every minute and the browser streams each new entry over a WebSocket. Hydratable How hydratable() works — compute a value once on the server and reuse it on the client instead of re-running async work during hydration. Tailwind Todo App Classic todo app styled with Tailwind CSS.