Skip to main content

Getting Started

Introduction

A zero-route admin panel for SvelteKit with Prisma and Drizzle adapters.


sveltekit-admin turns an existing Prisma or Drizzle schema into a server-rendered admin panel. It is a SvelteKit handle hook: there are no generated routes, no admin database, and no UI scaffold to maintain.

Choose your path

  • Prisma — use the root package export and pass your generated client. This is the shortest path and is covered by the Prisma quick start.
  • Drizzle — import both createAdminHandler and createDrizzleAdapter from sveltekit-admin/adapters/drizzle. The adapter receives the db and the schema object you already export.
  • Custom adapter — implement the public { introspector, data } contract when your data source is neither Prisma nor Drizzle. See the configuration reference.

What you get

Opening /admin (or your configured basePath) provides a dashboard, paginated lists, generated create/edit forms, relation widgets, search, filters, sorting, and destructive actions with confirmation. The handler intercepts only its admin paths; your application routes remain yours.

The important safety defaults

Before exposing the panel, configure an authCheck. Use models[].scope for tenant or row authorization; listWhere only narrows list/search results and is not an authorization boundary. CSRF Origin verification is enabled for state-changing requests. Fields named like password, hash, secret, or token, plus fields in hidden, are excluded from sensitive UI and callback payloads.

Requirements

  • SvelteKit 2 and Svelte 5
  • Prisma 5+ for the Prisma shortcut, or Drizzle ORM 0.32+ for the Drizzle adapter
  • Node.js and pnpm/npm/bun suitable for your SvelteKit app

Next steps

  1. Follow Installation & Quick Start.
  2. Add authentication and logout before sharing /admin.
  3. Configure models, fields, and scopes.
  4. Keep the troubleshooting guide nearby while integrating.