Generate experiences with Puck AI
Read docs
CloudSet up Cloud plugins

Set up Cloud plugins

Puck Cloud provides plugins for using each module from within Puck Editor.

You can also use Puck Cloud from your backend with the server APIs.

Via the CLI

To prepare your app for plugins using the CLI:

npx @puckeditor/core add cloud

This adds the endpoints that the plugins use to reach Puck Cloud.

Manual setup

Add server-side endpoints

Mount the Puck handler server-side to create the plugin endpoints for /api/puck/* using the puckHandler() API.

// app/api/puck/[...all]/route.ts

import { puckHandler } from "@puckeditor/cloud-client";

const handleRequest = (request) => {
  // TODO: authenticate this endpoint
  return puckHandler(request);
};

export const DELETE = handleRequest;
export const GET = handleRequest;
export const POST = handleRequest;

Configure auth

By default, this endpoint is open to anyone. Authenticate it yourself, or let Puck Auth manage sign-in:

// app/api/puck/[...all]/route.ts

import { puckHandler } from "@puckeditor/cloud-client";

const handleRequest = (request) => {
  return puckHandler(request, {
    auth: { provider: "puck" }
  });
};

export const DELETE = handleRequest;
export const GET = handleRequest;
export const POST = handleRequest;

Add plugins

Finally, set up the plugins you need:

  • Puck AI: Generate pages using AI
  • Puck Auth: Managed authentication
  • Puck Pages: Page database with versions and data migrations (coming soon)

Further reading