Search forkrail

Search documentation, comparisons, and CLI commands.

All frameworks/SvelteKit
Websites & full-stack
Production ready

Deploy SvelteKit on forkrail

Keep @sveltejs/adapter-vercel or adapter-auto unchanged. forkrail imports the Build Output directly for SSR, streaming, ISR, image optimization, and skew protection inside your AWS account.

Adapter
@sveltejs/adapter-vercel or adapter-auto
Runtime
Node.js 24 (arm64) or Static S3
Detection
package.json (@sveltejs/kit)
Memory
1,024 MB recommended for SSR
  • SSR & streaming
    Full streaming SSR, form actions, hooks, and $env
  • ISR caching
    Per-route config.isr cached in the regional router
  • Image optimization
    Adapter images config served via /_vercel/image
  • Skew protection
    Enabled by default; pins open tabs to their deployment

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.

svelte.config.js
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.

Deploy SvelteKit with the CLI
# Set recommended memory once for the project
forkrail project my-svelte-app --memory 1024
# Deploy a preview URL
forkrail deploy
# Ship to production
forkrail deploy --prod

3. 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).

src/routes/blog/[slug]/+page.server.ts
export const config = {
isr: {
expiration: 60,
},
}
export async function load({ params }) {
return { slug: params.slug, renderedAt: new Date().toISOString() }
}
Shared function memory for split routes

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).

Ready to deploy your SvelteKit project inside your own AWS account?
Quickstart