sveltekit-remote-functions
Original:🇺🇸 English
Not Translated
SvelteKit remote functions guidance. Use for command(), query(), form() patterns in .remote.ts files.
1installs
Added on
NPX Install
npx skill4agent add spences10/svelte-claude-skills sveltekit-remote-functionsSKILL.md Content
SvelteKit Remote Functions
Quick Start
File naming: for remote function files
*.remote.tsWhich function? One-time action → | Repeated reads →
| Forms →
command()query()form()Example
typescript
// 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' });Reference Files
- references/remote-functions.md - Complete guide with all patterns
Notes
- Remote functions execute on server when called from browser
- Args/returns must be JSON-serializable
- Schema validation via StandardSchemaV1 (Valibot/Zod)
- available for cookies/headers access
getRequestEvent() - Queries are cached - use to get fresh data
.refresh() - No .remote files in - they won't work there
src/lib/server/ - Last verified: 2025-12-19