Skip to content

Commit

Permalink
chore: move session to top-level config option (#13241)
Browse files Browse the repository at this point in the history
* chore: add heading for session

* move session to top-level config option

---------

Co-authored-by: Sarah Rainsberger <[email protected]>
  • Loading branch information
ematipico and sarah11918 authored Feb 13, 2025
1 parent d79ee8c commit 723c843
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions packages/astro/src/types/public/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,37 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
checkOrigin?: boolean;
};

/**
* @docs
* @kind heading
* @name session
* @type {SessionConfig}
* @version 5.3.0
* @description
*
* Configures experimental session support by specifying a storage `driver` as well as any associated `options`.
* You must enable the `experimental.session` flag to use this feature.
* Some adapters may provide a default session driver, but you can override it with your own configuration.
*
* You can specify [any driver from Unstorage](https://unstorage.unjs.io/drivers) or provide a custom config which will override your adapter's default.
*
* See [the experimental session guide](https://docs.astro.build/en/reference/experimental-flags/sessions/) for more information.
*
* ```js title="astro.config.mjs"
* {
* session: {
* // Required: the name of the Unstorage driver
* driver: 'redis',
* // The required options depend on the driver
* options: {
* url: process.env.REDIS_URL,
* },
* }
* }
* ```
*/
session?: SessionConfig<TSession>;

/**
* @docs
* @name vite
Expand Down Expand Up @@ -1724,36 +1755,6 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
validateSecrets?: boolean;
};

/**
* @docs
* @name session
* @type {SessionConfig}
* @version 5.3.0
* @description
*
* Configures experimental session support by specifying a storage `driver` as well as any associated `options`.
* You must enable the `experimental.session` flag to use this feature.
* Some adapters may provide a default session driver, but you can override it with your own configuration.
*
* You can specify [any driver from Unstorage](https://unstorage.unjs.io/drivers) or provide a custom config which will override your adapter's default.
*
* See [the experimental session guide](https://docs.astro.build/en/reference/experimental-flags/sessions/) for more information.
*
* ```js title="astro.config.mjs"
* {
* session: {
* // Required: the name of the Unstorage driver
* driver: 'redis',
* // The required options depend on the driver
* options: {
* url: process.env.REDIS_URL,
* },
* }
* }
* ```
*/
session?: SessionConfig<TSession>;

/**
*
* @kind heading
Expand Down

0 comments on commit 723c843

Please sign in to comment.