mit einem Klick
sveltekit-remote-functions
// SvelteKit remote functions guidance. Use for command(), query(), form() patterns in .remote.ts files.
// SvelteKit remote functions guidance. Use for command(), query(), form() patterns in .remote.ts files.
Research topics by verifying actual source content. Use when asked to research or study links and documentation.
Svelte component patterns. Use for web components, component libraries (Bits UI, Ark UI, Melt UI), form patterns, or third-party integration.
Svelte deployment guidance. Use for adapters, Vite config, pnpm setup, library authoring, PWA, or production builds.
Svelte runes guidance. Use for reactive state, props, effects, attachments, or migration. Covers $state, $derived, $effect, @attach. Prevents reactivity mistakes.
SvelteKit data flow guidance. Use for load functions, form actions, and server/client data. Covers +page.server.ts vs +page.ts, serialization, fail(), redirect(), error().
SvelteKit structure guidance. Use for routing, layouts, error handling, SSR, or svelte:boundary. Covers file naming, nested layouts, error boundaries, pending UI, and hydration.
| name | sveltekit-remote-functions |
| description | SvelteKit remote functions guidance. Use for command(), query(), form() patterns in .remote.ts files. |
File naming: *.remote.ts for remote function files
Which function? One-time action → command() | Repeated reads →
query() | Forms → form()
// actions.remote.ts
import { command } from '$app/server';
import * as v from 'valibot';
export const delete_user = command(
v.object({ id: v.string() }),
async ({ id }) => {
await db.users.delete(id);
return { success: true };
},
);
// Call from client: await delete_user({ id: '123' });
getRequestEvent() available for cookies/headers access.refresh() to get fresh datasrc/lib/server/ - they won't work there