Skip to content

Commit

Permalink
Update index.md - Added specific configuration example for Svelte/Kit (
Browse files Browse the repository at this point in the history
…#1429)

Co-authored-by: pilcrow <[email protected]>
  • Loading branch information
lolcabanon and pilcrowonpaper authored Feb 15, 2024
1 parent 0b86518 commit e73222e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
13 changes: 11 additions & 2 deletions docs/pages/getting-started/sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ title: "Getting started in Sveltekit"

## Installation

Install Lucia using your package manager of your choice. While not strictly necessary, we recommend installing [Oslo](https://oslo.js.org), which Lucia is built on, for various auth utilities (which a lot of the guides use).
Install Lucia using your package manager of your choice.

```
npm install lucia oslo
npm install -D lucia
```

While not strictly necessary, we recommend installing [Oslo](https://oslo.js.org), which Lucia is built on, for various auth utilities (which a lot of the guides use).

If you use `@sveltejs/adapter-node`, make sure to install `oslo` as a `dependency`, not as `devDependency` to prevent Rollup from bundling `oslo`. See the [SvelteKit documentation](https://kit.svelte.dev/docs/adapter-node#deploying) for details.

```
npm install oslo
```


## Initialize Lucia

Import `Lucia` and initialize it with your adapter. Refer to the [Database](/database) page to learn how to set up your database and initialize the adapter. Make sure to configure the `sessionCookie` option and register your `Lucia` instance type
Expand Down
12 changes: 12 additions & 0 deletions docs/pages/upgrade-v3/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,15 @@ const nextConfig = {
}
};
```

### SvelteKit

#### @sveltejs/adapter-node

Make sure to install `oslo` as a `dependency`, not as `devDependency` to prevent `@sveltejs/adapter-node` from bundling `oslo`.

As per SvelteKit documentation :

>Development dependencies will be bundled into your app using Rollup. To control whether a given package is bundled or externalised, place it in devDependencies or dependencies respectively in your package.json.
See [SvelteKit documentation](https://kit.svelte.dev/docs/adapter-node#deploying) for details.

0 comments on commit e73222e

Please sign in to comment.