kavachOS
Authentication

Naver

Sign in with Naver using OAuth 2.0.

Setup

Get credentials

Go to developers.naver.com and create an application. Under API Settings, add Naver Login and set your redirect URI:

https://your-app.com/api/kavach/auth/oauth/callback/naver

Configure

lib/kavach.ts
import { createKavach } from 'kavachos';
import { oauth } from 'kavachos/auth';

const kavach = await createKavach({
  database: { provider: 'sqlite', url: 'kavach.db' },
  plugins: [
    oauth({
      providers: [
        {
          id: 'naver',
          clientId: process.env.NAVER_CLIENT_ID!,
          clientSecret: process.env.NAVER_CLIENT_SECRET!,
        },
      ],
    }),
  ],
});
NAVER_CLIENT_ID=...
NAVER_CLIENT_SECRET=...

Scopes

Default scopes: name, email

ScopeWhat it unlocks
nameDisplay name
emailEmail address
profile_imageProfile image URL
mobileMobile phone number

Endpoints

MethodPathDescription
GET/auth/oauth/authorize/naverRedirect to Naver
GET/auth/oauth/callback/naverHandle callback

On this page