# `getNextAdminProps` 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>

<Tabs items={['App router', 'Pages router']}>
  <Tabs.Tab>
    The following is used only for App router.

    `getNextAdminProps` is a function that returns the props for the [`NextAdmin`](https://next-admin.js.org/docs/api/next-admin-component) component. It accepts one argument which is an object with the following properties:

    <OptionsTable
          options={[
            {
              name: 'params',
              description: <> The array of route params retrieved from the <a href="https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#optional-catch-all-segments">optional catch-all segment</a></>
            },
            {
              name: 'searchParams',
              description: <> The query params <a href="https://nextjs.org/docs/app/api-reference/file-conventions/page#searchparams-optional">retrieved from the page</a></>
            },
            {
              name: 'basePath',
              description: 'The base path of your admin. It is used to build the admin URL. It is mandatory.'
            },
            {
              name: 'apiBasePath',
              description: 'The base path of your admin API. It is used to build the admin API URL. It is mandatory.'
            },
            {
              name: 'prisma',
              description: 'Your Prisma client instance.'
            },
            {
              name: 'getMessages',
              description: <>A function with no parameters that returns translation messages. It is used to translate the default messages of the library. See <a href="/docs/i18n">i18n</a> for more details.</>
            },
            {
              name: 'locale',
              description: <>The locale used, find from params (e.g. <code>en</code>, <code>fr</code>).</>
            },
            {
              name: 'options',
              description: <>The <a href="/docs/api/options">options</a> object - optional.</>
            }
      ]}
    />

  </Tabs.Tab>
  <Tabs.Tab>
    The following is used only for Pages router

    `getNextAdminProps` is a function that returns the props for the [`NextAdmin`](https://next-admin.js.org/docs/api/next-admin-component) component. It accepts one argument which is an object with the following properties:

    <OptionsTable
      options={[
        {
          name: 'basePath',
          description: <>The base path of your admin. It is used to build the admin URL. It is optional and defaults to <code>/admin</code>.</>
        },
        {
          name: 'apiBasePath',
          description: <>The base path of your admin API. It is used to build the admin API URL. It is optional and defaults to <code>/api/admin</code>.</>
        },
        {
          name: 'prisma',
          description: 'Your Prisma client instance.'
        },
        {
          name: 'req',
          description: <>The request object from the page (<code>IncomingMessage</code>). </>
        },
        {
          name: 'getMessages',
          description: <>A function with no parameters that returns translation messages. It is used to translate the default messages of the library. See <a href="/docs/i18n">i18n</a> for more details.</>
        },
        {
          name: 'locale',
          description: <>The locale used, find from params (e.g. <code>en</code>, <code>fr</code>).</>
        },
        {
          name: 'options',
          description: <>The <a href="/docs/api/options">options</a> object - optional.</>
        }

      ]}
      />

  </Tabs.Tab>
</Tabs>
