---
title: "SvelteKit Authentication"
description: "A SvelteKit app with authentication."
url: "https://vercel.com/templates/svelte/sveltekit-authentication"
links:
  repository: "https://github.com/nextauthjs/sveltekit-auth-example"
  demo: "https://sveltekit-auth-example.vercel.app/"
  deploy: "https://vercel.com/new/clone?demo-title=SvelteKit+Authentication&demo-description=A+SvelteKit+app+with+authentication.&demo-url=https%3A%2F%2Fsveltekit-auth-example.vercel.app%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F5MLbsADtCPP0UDFL97DA3U%2F64ddd2cd9cc891329c593108e1c517d3%2FCleanShot_2022-12-14_at_10.12.33_2x.png&project-name=SvelteKit+Authentication&repository-name=sveltekit-authentication&repository-url=https%3A%2F%2Fgithub.com%2Fnextauthjs%2Fsveltekit-auth-example&from=templates&skippable-integrations=1&env=AUTH_SECRET%2CGITHUB_ID%2CGITHUB_SECRET&envDescription=https%3A%2F%2Fdocs.github.com%2Fen%2Fdevelopers%2Fapps%2Fbuilding-oauth-apps%2Fcreating-an-oauth-app"
---

# SvelteKit Authentication

A SvelteKit app with authentication.

> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/examples/sveltekit). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).

<p align="center">
   <br/>
   <a href="https://authjs.dev" target="_blank">
   <img height="64" src="https://authjs.dev/img/logo-sm.png" />
   </a>
   <a href="https://kit.svelte.dev" target="_blank">
   <img height="64" src="https://upload.wikimedia.org/wikipedia/commons/1/1b/Svelte_Logo.svg" />
   </a>
   <h3 align="center"><b>SvelteKit Auth</b> - Example App</h3>
   <p align="center">
   Open Source. Full Stack. Own Your Data.
   </p>
   <p align="center" style="align: center;">
      <a href="https://npm.im/@auth/sveltekit">
        <img alt="npm" src="https://img.shields.io/npm/v/@auth/sveltekit?color=green&label=@auth/sveltekit&style=flat-square">
      </a>
      <a href="https://bundlephobia.com/result?p=@auth/sveltekit">
        <img src="https://img.shields.io/bundlephobia/minzip/@auth/sveltekit?label=size&style=flat-square" alt="Bundle Size"/>
      </a>
      <a href="https://www.npmtrends.com/@auth/sveltekit">
        <img src="https://img.shields.io/npm/dm/@auth/sveltekit?label=downloads&style=flat-square" alt="Downloads" />
      </a>
      <a href="https://npm.im/@auth/sveltekit">
        <img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
      </a>
   </p>
</p>

## Overview

This is the official SvelteKit Auth example for [Auth.js](https://sveltekit.authjs.dev).

## Getting started

You can instantly deploy this example to [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=sveltekit-auth-example) by clicking the following button.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/nextauthjs/sveltekit-auth-example&project-name=sveltekit-auth-example&repository-name=sveltekit-auth-example)

## Related Templates

### [SvelteKit Boilerplate](https://vercel.com/templates/svelte/sveltekit-boilerplate)

A SvelteKit app including nested routes, layouts, and page endpoints.

### [SvelteKit Commerce](https://vercel.com/templates/svelte/sveltekit-commerce)

An all-in-one starter kit for high-performance e-commerce sites built with SvelteKit.

### [Turborepo & SvelteKit Starter](https://vercel.com/templates/svelte/turborepo-sveltekit-starter)

This is an official starter Turborepo with two SvelteKit apps and two local packages.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
