1. Configure your SvelteKit adapter
If your project already uses @sveltejs/adapter-vercel or @sveltejs/adapter-auto, nothing needs to change — forkrail sets VERCEL=1 during builds so adapter-auto automatically selects Vercel’s adapter. Projects using @sveltejs/adapter-static deploy as zero-Lambda static sites served straight from S3.
import adapter from '@sveltejs/adapter-vercel'import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'export default { preprocess: vitePreprocess(), kit: { adapter: adapter({ images: { sizes: [640, 1080, 1920], formats: ['image/avif', 'image/webp'], }, }), },}2. Deploy preview & production
Deploy from your terminal or connect the repository in Settings → Git for automatic branch previews. Because SSR is CPU-bound, 1,024 MB gives noticeably faster renders than the 640 MB default.
# Set recommended memory once for the projectforkrail project my-svelte-app --memory 1024# Deploy a preview URLforkrail deploy# Ship to productionforkrail deploy --prod3. ISR, split routes & client IP
Per-route export const config works as written for ISR (expiration, bypassToken, allowQuery), memory, and maxDuration. event.getClientAddress() always returns the visitor’s real IP (forkrail strips spoofed x-forwarded-for headers at the router).
export const config = { isr: { expiration: 60, },}export async function load({ params }) { return { slug: params.slug, renderedAt: new Date().toISOString() }}With split: true, forkrail packs all route functions into one shared Lambda function sized to the largest memory requested while enforcing each route’s own maxDuration at the router. Files read with SvelteKit’s read() are bundled automatically.
4. Environment variables & AWS access
Add runtime secrets ($env/dynamic/private) and build-time variables ($env/static/public) through Settings → Environment Variables or forkrail env add. To reach S3, DynamoDB, or Bedrock without static IAM keys, attach an IAM role to the project (forkrail project my-svelte-app --role my-app-role).