Frontend with Next.js
Frontend with Next.js
If the app already depends on NEXT_PUBLIC_*, keep that contract while CNOS becomes the source of truth:
cnos build public --framework next --profile prod --to .env.productionimport { withCnosNext } from '@kitsy/cnos-next';
export default withCnosNext({});Browser-safe values remain under public.promote and are exposed as NEXT_PUBLIC_* plus browser-runtime data for @kitsy/cnos/browser.
Migration path:
- keep
NEXT_PUBLIC_*via generated env or Next env injection - add
withCnosNext() - move browser-safe reads to
@kitsy/cnos/browser - move server-only reads to
@kitsy/cnosor@kitsy/cnos/configure