> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chipipay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Next.js with Clerk

> Learn how to integrate Chipi Pay with your Next.js application using Clerk for authentication and secure wallet storage.

<Steps>
  <Step title="Getting Started" titleSize="h2">
    To get started with Chipi Pay in your Next.js application

    ```bash theme={null}
    npx create-next-app@latest my-chipi-app
    cd my-chipi-app
    ```

    <Note>
      If you get `ERESOLVE` peer dependency errors when installing Clerk, run `npm install --legacy-peer-deps`. This is a known Clerk + React 19 compatibility issue.
    </Note>

    With Clerk, you can follow their [Quickstart Guide](https://clerk.com/docs/quickstarts/nextjs) to get started.
  </Step>

  <Step title="Install the Chipi SDK" titleSize="h2">
    First, install the required packages:

    ```bash theme={null}
    # Install Chipi Pay SDK
    npm install @chipi-stack/nextjs

    # Install Clerk
    npm install @clerk/nextjs
    ```
  </Step>

  <Step title="Setup the Chipi SDK Provider" titleSize="h2">
    1. Create a `.env` file in your project root and add your API keys:

    ```bash theme={null}
    NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
    CLERK_SECRET_KEY=your_clerk_secret_key
    NEXT_PUBLIC_CHIPI_API_KEY=your_chipi_api_public_key
    CHIPI_SECRET_KEY=your_chipi_api_secret_key
    ```

    Get your Chipi API keys from the [Chipi Dashboard](https://dashboard.chipipay.com) quickstart. Get your Clerk keys from the [Clerk Dashboard](https://dashboard.clerk.com/last-active?path=api-keys).

    2. Set up the Chipi Pay provider in your application:

    ```tsx theme={null}
    // app/layout.tsx

    import { ClerkProvider } from "@clerk/nextjs";
    import { ChipiProvider } from "@chipi-stack/nextjs";

    export default function RootLayout({children}: {
      children: React.ReactNode;
    }) {
      return (
        <html lang="en">
          <body>
            <ClerkProvider>
              <ChipiProvider>{children}</ChipiProvider>
            </ClerkProvider>
          </body>
        </html>
      );
    }
    ```
  </Step>
</Steps>

<Tip>
  Need help? Check out our [Telegram Community](https://t.me/+e2qjHEOwImkyZDVh) for
  support and to connect with other developers.
</Tip>
