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 --saveimport { 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
| Param | Example | Type | Status |
|---|---|---|---|
host | host: "https://www.example.com/api/puck/assets" | String | - |
label | label: "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",
});