Configuration options for Next.js with app router

This configuration file lives in the root of your Next.js project and can be used to adjust the behavior of the Uniform SDK.

uniform.server.config.js

/** @type {import('@uniformdev/canvas-next-rsc/config').UniformServerConfig} */ module.exports = { defaultConsent: true, };

defaultConsent controls whether the user has opted into Context functionality by default. The value you use here will depend on your requirements. If your site is subject to cookie consent, this should be false and consent should be toggled via code when consent is granted.

By default while in server mode, personalization will be evaluated on the server for users. If you would prefer it to be evaluated on the client (useful for the static mode), you can configure this here:

uniform.server.config.js

/** @type {import('@uniformdev/canvas-next-rsc/config').UniformServerConfig} */ module.exports = { defaultConsent: true, evaluation: { personalization: 'client', } };

Likewise, you can control where tests are evaluated:

uniform.server.config.js

/** @type {import('@uniformdev/canvas-next-rsc/config').UniformServerConfig} */ module.exports = { defaultConsent: true, evaluation: { testing: 'client', } };