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/naverConfigure
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
| Scope | What it unlocks |
|---|---|
name | Display name |
email | Email address |
profile_image | Profile image URL |
mobile | Mobile phone number |
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /auth/oauth/authorize/naver | Redirect to Naver |
| GET | /auth/oauth/callback/naver | Handle callback |