Server configuration

Developer preview

This feature is in developer preview. Use with caution as it may change unexpectedly. For more information, contact us.

Developer Preview

This page documents the developer preview of the SDK, version 20.81.1-alpha.25.sha-f076f9b857.

uniform.server.config.ts is optional:

uniform.server.config.ts

import type { UniformServerConfig } from "@uniformdev/next-app-router/config"; const config: UniformServerConfig = { // Default storage consent for new visitors. defaultConsent: true, // The playground route (default: "/uniform/playground"). playgroundPath: "/playground", context: { // Turns off the Uniform Context dev tools (default: false). disableDevTools: false, // Custom personalization selection algorithms for the server and the edge. personalizationSelectionAlgorithms: {}, }, // Keeps quirks in a cookie for the browser Context (default: true). quirkSerialization: true, }; export default config;
OptionDefaultDescription
defaultConsenttrue with no file, false when your file does not set itThe storage consent for new visitors. The middleware writes it into the code.
playgroundPath"/uniform/playground"The route of the pattern playground.
context.disableDevToolsfalseTurns off the Uniform Context dev tools.
context.personalizationSelectionAlgorithmsnoneCustom personalization algorithms, by name. Refer to Custom personalization algorithms.
quirkSerializationtrueKeeps quirks in a cookie for the browser Context.

warning

Your file replaces the default configuration fully. The SDK does not merge the two. Without a file, defaultConsent is true. With a file that does not set defaultConsent, it is false. Always set defaultConsent in your file.

Developer Preview

The options middlewareRuntimeCache and experimental.disableSwrMiddlewareCache are removed, because the middleware makes no API calls. context.personalizationSelectionAlgorithms is new.