Beta
Publish to Next.js
Render Optimizly articles in your Next.js App Router site with ISR and instant revalidation on publish.
- Connects via
- @optimizly/next package on top of the headless content API and signed webhooks
- Lands as
- Your own Next.js app (App Router)
- Tested
- Automated API tests
What syncs
What Optimizly writes
- Article list and single article with ISR + per-article cache tags
- generateMetadata: title, description, canonical, Open Graph, Twitter and JSON-LD
- app/sitemap.ts entries for every published article
- Route handler that verifies the webhook signature and calls revalidateTag/revalidatePath
Limitations
Good to know
- Version 0.1.0 is not on npm yet: install it from the repository (packages/optimizly-next) until it is published.
- Read-only: the package renders content; writing articles stays in Optimizly or API v1.
Setup
Connect Next.js
- Install @optimizly/next (see limitations) and set OPTIMIZLY_TRACKING_KEY (Websites → headless API).
- Use createOptimizlyNext() in a server module and call getArticles, getArticle, generateStaticParams and sitemap in your routes.
- Add app/api/optimizly/route.ts with export const POST = createWebhookHandler().
- Create a webhook in Optimizly (API v1: POST /v1/webhooks) pointing to https://<your-site>/api/optimizly and store its secret as OPTIMIZLY_WEBHOOK_SECRET.
Publish your next article to Next.js.
Start a free trial, add your site as publishing target and test the connection.