Skip to content
Optimizly
Beta

Publish to Nuxt

Render Optimizly articles in your Nuxt 3/4 site with SEO meta and a cache purge on publish.

Connects via
@optimizly/nuxt module on top of the headless content API and signed webhooks
Lands as
Your own Nuxt 3 or 4 app
Tested
Automated API tests

What syncs

What Optimizly writes

  • useOptimizlyArticles / useOptimizlyArticle composables (SSR, Nitro-cached)
  • useSeoMeta, canonical and JSON-LD from the article
  • Webhook route that verifies the signature and purges the Nitro cache
  • Sitemap source for @nuxtjs/sitemap

Limitations

Good to know

  • Version 0.1.0 is not on npm yet: install it from the repository (packages/optimizly-nuxt) until it is published.
  • The purge clears the Nitro cache storage; with several instances mount a shared storage (e.g. Redis). CDN/ISR purging goes through the optimizly:webhook hook.

Setup

Connect Nuxt

  1. Add @optimizly/nuxt to modules (see limitations) and set NUXT_PUBLIC_OPTIMIZLY_TRACKING_KEY.
  2. Use useOptimizlyArticles() on your blog index and useOptimizlyArticle(slug) on the article page.
  3. Create a webhook in Optimizly pointing to https://<your-site>/api/_optimizly/webhook and set NUXT_OPTIMIZLY_WEBHOOK_SECRET.

Frameworks

All integrations

Publish your next article to Nuxt.

Start a free trial, add your site as publishing target and test the connection.