# `createHandler` function

<Callout type="info">
  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](https://next-admin.js.org/v4/docs)
</Callout>

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

<OptionsTable
  options={[
    {
      name: "prisma",
      description: "Your Prisma client instance. This is mandatory.",
    },
    {
      name: "onRequest",
      description:
        "A function that is executed before any request. Useful for authentication.",
    },
    {
      name: "options",
      description: (
        <>
          Your Next Admin <a href="/docs/api/options">options</a> - optional.{" "}
        </>
      ),
    },
  ]}
/>
