Configuration
Contents
The adapter reads its connection and mapping settings from Next.js environment variables. Keep environment-specific values outside committed files when they contain secrets.
Server variables
| Name | Required | Purpose |
|---|---|---|
|
|
Yes |
Absolute Guillotine endpoint URL, normally ending in |
|
|
Yes |
XP application key that owns the content types and component descriptors used by the project. |
|
|
Yes |
Comma-separated |
|
|
Yes, for preview and revalidation |
Shared secret used by the starter’s protected API routes. It must match the Next.XP app configuration. |
|
|
No |
Enables adapter diagnostic logging when configured by the application. |
|
|
No |
Set to |
ENONIC_API=https://xp.example.com/site/
ENONIC_APP_NAME=com.example.site
ENONIC_MAPPINGS=en:website/site,no:website-no/site
ENONIC_API_TOKEN=replace-with-a-long-random-value
Browser-visible variables
When common adapter exports are used in client bundles, publish the non-secret equivalents explicitly:
NEXT_PUBLIC_ENONIC_API=$ENONIC_API
NEXT_PUBLIC_ENONIC_APP_NAME=$ENONIC_APP_NAME
NEXT_PUBLIC_ENONIC_MAPPINGS=$ENONIC_MAPPINGS
Never publish ENONIC_API_TOKEN. Values prefixed with NEXT_PUBLIC_ are embedded in browser JavaScript.
Next.js configuration
The starter configures @phrases for both webpack and Turbopack, transpiles @enonic/nextjs-adapter, and supplies a Content Security Policy compatible with Content Studio embedding. Preserve those settings when merging the integration into an existing Next.js application.
See Starter configuration for the complete connection between Next.js and the XP app.