Generate experiences with Puck AI
Read docs
CloudAPI referenceplugin-assetscreateAssetsPlugin

createAssetsPlugin

Puck Assets is in early access. Request access.

Create a plugin that adds an asset library for files stored in Puck Assets.

npm i @puckeditor/plugin-assets --save
import { createAssetsPlugin } from "@puckeditor/plugin-assets";
 
const assetsPlugin = createAssetsPlugin();
 
export function Editor() {
  return (
    <Puck
      plugins={[assetsPlugin]}
      // ...
    />
  );
}

The plugin needs puckHandler() on your server.

See Set up Puck Assets for a full setup.

Params

ParamExampleTypeStatus
hosthost: "https://www.example.com/api/puck/assets"String-
labellabel: "Archivos"String-

Optional params

host

Set where puckHandler serves the assets API. Defaults to /api/puck/assets.

const assetsPlugin = createAssetsPlugin({
  host: "https://www.example.com/api/puck/assets",
});

label

The plugin’s label in the plugin rail. Defaults to "Assets".

const assetsPlugin = createAssetsPlugin({
  label: "Archivos",
});