APIcreateHandler()

createHandler function

This is the documentation for the latest version of Next Admin. If you are using an older version (<5.0.0), please refer to the documentation

createHandler is a function that returns an object that allows you to catch all API access. It accepts an object with the following properties:

NameDescription
prismaYour Prisma client instance. This is mandatory.
onRequestA function that is executed before any request. Useful for authentication.
optionsYour Next Admin options - optional.