@openauth/naver
v0.6.0
Published
Naver OAuth library
Maintainers
Readme
@openauth/naver
Naver OAuth 2.0 client.
Install
# Deno
deno add jsr:@denostack/openauth
# Node.js / Bun
npx jsr add @denostack/openauth
# or
npm install @openauth/naverUsage
// Deno
import { NaverOAuth } from "@denostack/openauth/naver";
// Node.js / Bun
import { NaverOAuth } from "@openauth/naver";const oauth = new NaverOAuth({
clientId: "your_client_id",
clientSecret: "your_client_secret",
redirectUri: "https://example.com/callback/naver",
});
// 1. Generate the authorization URL and redirect the user
const url = await oauth.getAuthRequestUri({ state: "random_state" });
// 2. Exchange the authorization code for an access token
const token = await oauth.getAccessTokenResponse(code);
// 3. Fetch the user profile
const user = await oauth.getUserProfile(token.accessToken);
// => { id, nickname, name, email, picture, raw }Custom Scopes
Naver does not use scopes to control access — all permissions are configured in the Naver Developers application console. No scopes are requested by default.
