Run bknd inside Next.js
node -v
, and upgrade if necessary.bknd.config.ts
file in the root of your project. If you created the project using the CLI starter, this file is already created for you.
NextjsBkndConfig
type extends the BkndConfig
type with the following additional properties:
bknd.config.ts
file:
src/api/[[...bknd]]/route.ts
:
admin/[[...admin]]/page.tsx
:
getApi
helper function we’ve already set up to fetch and mutate in static pages and server components: