Open navigation
Direct

Install in Next.js

Install @flatzer/nextjs 1.0.0 and render FlatzerWidget from a layout or page without turning the whole layout into a Client Component.

npmv1.0.0

@flatzer/nextjs

Official component for App Router and Pages Router.

See it before you do it

Flatzer screenshots and visual platform references show you exactly where to act.

Terminal installing the official Flatzer package
Terminal · bun add @flatzer/widgetVisual reference
Editor with FlatzerWidget added to a Next.js layout
Next.js · app/layout.tsxVisual reference
Official component
import { FlatzerWidget } from '@flatzer/nextjs'

<FlatzerWidget widgetKey={process.env.FLATZER_WIDGET_KEY!} />
Install the package
bun add @flatzer/nextjs

App Router

The public @flatzer/[email protected] package owns the client boundary. Import FlatzerWidget in a server layout or page and pass widgetKey; do not add use client to the root layout only to render the widget.

Pages Router

You can also mount the component in pages/_app.tsx to share it across pages. Read the key from an environment value exposed to the browser and allow every production and preview domain.