Config

Persistence

Defines the strategy for persisting locale state.


Note
Currently, Intor provides cookie-based persistence as the only mechanism for preserving locale state.
This design aims to offer a simple, predictable, and highly environment-compatible default solution.

Defines how locale state is persisted via cookies.

defineIntorConfig({
  cookie: {...},
});

Whether to enable writing the resolved locale state into a cookie.

Defaults to true

defineIntorConfig({
  cookie: {
    persist: true,
  },
});

The name of the cookie used to store locale state.

Defaults to "intor.locale"

defineIntorConfig({
  cookie: {
    name: "my-cookie-name",
  },
});

The domain scope of the cookie.

Defaults to undefined

The path scope of the cookie.

Defaults to "/"

The cookie lifetime, in seconds.

Defaults to 60 * 60 * 24 * 365 (365 days)

Whether to restrict the cookie to HTTP(S) access only.

Defaults to false

Whether the cookie is only sent over secure (HTTPS) connections.

Defaults to process.env.NODE_ENV !== "development"

The SameSite policy of the cookie.

Defaults to "lax"