<Editor />
Component
import { Editor } from "@wecre8websites/strapi-page-builder-react";
import "@wecre8websites/strapi-page-builder-react/editor.css"
import { notFound } from "next/navigation";
import config from "../../blocks/PageBuilderConfig";
const strapiConfig = {
url: process.env.NEXT_PUBLIC_API_URL as string,
authToken: process.env.STRAPI_ADMIN_TOKEN as string,
imageUrl: process.env.NEXT_PUBLIC_IMAGE_URL as string,
}
export default async function EditorPage({ searchParams }: { searchParams: Promise<{ _pagebuilderToken?: string }> }) {
const { _pagebuilderToken } = await searchParams;
if (!_pagebuilderToken) return notFound();
return <Editor config={config} apiKey={process.env.PAGE_BUILDER_API_KEY as string} strapi={strapiConfig} />
}
Props
Parameter | Description | Required |
---|---|---|
apiKey | The API key for the Strapi Page Builder. Sign up for free. | true |
config | The configuration object for the Strapi Page Builder. See Editor Configuration. | true |
strapi | The configuration object for Strapi. | false |
Strapi Configuration Object
Parameter | Description | Required |
---|---|---|
url | The URL of the Strapi API. | true |
authToken | The authentication token for Strapi if required. | false |
imageUrl | The URL of the image server. Required if using the media field type | false |
Last updated on