Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

add full redis config example #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,28 @@ You can use any storage driver supported by [unjs/unstorage](https://github.com/
// file: ~/nuxt.config.ts
export default defineNuxtConfig({
modules: ['@sidebase/nuxt-session'],
// the build time config is needed, so that the nuxt module selects the right driver module during build
session: {
session: {
storageOptions: {
driver: 'redis',
options: {
url: 'redis://localhost:6379'
}
}
}
},
// the runtime config is needed, to specify the shape of the config object.
// a dummy value for the url, that can be overridden by nuxt's runtime env var system
// https://nuxt.com/docs/guide/going-further/runtime-config#environment-variables
runtimeConfig: {
session: {
session: {
storageOptions: {
driver: 'redis',
options: {
// overriden by NUXT_SESSION_SESSION_STORAGE_OPTIONS_OPTIONS_URL env var
url: 'UNDEFINED' // you need to define the key, with a dummy value
}
}
}
}
Expand Down