---
title: "Quickstart"
description: "Get started with AuthSetu authentication and identity verification in less than 5 minutes."
order: 1
category: "Getting Started"
updated: "2026-10-13"
---

# Quickstart Guide

This guide walks you through setting up an AuthSetu account, obtaining your API keys, and adding authentication to your application.

## Prerequisites

- Node.js 18+ or Go 1.22+
- An active AuthSetu account (sign up at [authsetu.com](https://authsetu.com))
- Your Publishable Key and Secret Key from the [Developer Console](https://console.authsetu.com)

## Step 1: Install the SDK

Run the following command in your terminal:

```bash
pnpm add @authsetu/nextjs @authsetu/react
```

Or with npm:

```bash
npm install @authsetu/nextjs @authsetu/react
```

## Step 2: Configure Environment Variables

Create or update `.env.local` in your project root with your credentials:

```env
NEXT_PUBLIC_AUTHSETU_PUBLISHABLE_KEY=pk_test_sample12345
AUTHSETU_SECRET_KEY=sk_test_sample67890
NEXT_PUBLIC_AUTHSETU_API_URL=https://api.authsetu.com
```

<Callout type="warning">
Never expose `AUTHSETU_SECRET_KEY` in client-side code or commit it to version control. Keep all server secrets in protected environment configurations.
</Callout>

## Step 3: Wrap Your Application with AuthProvider

In Next.js App Router, wrap your root layout with `AuthProvider`:

```tsx
// app/layout.tsx
import { AuthProvider } from '@authsetu/nextjs';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        <AuthProvider
          publishableKey={process.env.NEXT_PUBLIC_AUTHSETU_PUBLISHABLE_KEY!}
        >
          {children}
        </AuthProvider>
      </body>
    </html>
  );
}
```

## Step 4: Mount the Prebuilt SignIn Component

Create a sign-in route at `app/sign-in/page.tsx`:

```tsx
// app/sign-in/page.tsx
import { SignIn } from '@authsetu/react';

export default function SignInPage() {
  return (
    <main className="min-h-screen flex items-center justify-center p-4">
      <SignIn redirectUrl="/dashboard" />
    </main>
  );
}
```

## Next Steps

- Explore the [Next.js SDK Guide](/docs/getting-started/nextjs) for middleware and server actions.
- Check out [Multi-Factor Authentication](/docs/authentication/mfa) for SMS and TOTP setup.
- Integrate [DigiLocker Verification](/docs/data-core/overview) for instant document checks.
