Heavstal Auth — Heavstal Tech를 위한 NextAuth Provider

발행: (2025년 12월 30일 오전 05:40 GMT+9)
2 min read
원문: Dev.to

Source: Dev.to

Overview

Heavstal Tech용 공식 NextAuth.js (Auth.js) 프로바이더입니다.
인증 URL, 토큰 엔드포인트, 사용자 프로필 매핑을 직접 설정하지 않고도 Next.js 애플리케이션에 “Sign in with Heavstal”을 손쉽게 통합할 수 있습니다.

  • 📦 npm:
  • 📂 GitHub:

Installation

npm install heavstal-auth
# or
yarn add heavstal-auth
# or
pnpm add heavstal-auth

Note: next-auth가 프로젝트에 설치되어 있어야 합니다.

Configuration

  1. Heavstal Developer Console에 접속하여 새 애플리케이션을 생성하고 Client IDClient Secret을 발급받습니다.
  2. 이를 환경 파일(.env 또는 .env.local)에 추가합니다:
HEAVSTAL_CLIENT_ID=ht_id_xxxxxxxxxxxx
HEAVSTAL_CLIENT_SECRET=ht_secret_xxxxxxxxxxxx

Usage

NextAuth 설정에 프로바이더를 추가합니다.

// app/api/auth/[...nextauth]/route.ts (or auth.ts)
import NextAuth from "next-auth";
import HeavstalProvider from "heavstal-auth";

const handler = NextAuth({
  providers: [
    HeavstalProvider({
      clientId: process.env.HEAVSTAL_CLIENT_ID!,
      clientSecret: process.env.HEAVSTAL_CLIENT_SECRET!,
    }),
  ],
  debug: process.env.NODE_ENV === "development",
});

export { handler as GET, handler as POST };

이 패키지는 TypeScript로 작성되었으며, 타입 정의가 기본 제공됩니다.

Provider Details

Heavstal 사용자 프로필에는 다음 필드가 포함됩니다:

  • id
  • name
  • email
  • image

Endpoints (pre‑configured)

  • Authorization URL: https://accounts-heavstal.vercel.app/oauth/authorize
  • Token URL: https://accounts-heavstal.vercel.app/api/oauth/token
  • User Info URL: https://accounts-heavstal.vercel.app/api/oauth/userinfo
  • Token Style: client_secret_post

엔드포인트를 직접 설정하거나 OIDC 디스커버리를 수행할 필요가 없습니다.

Resources

  • Heavstal Developer Console:
  • OAuth Documentation:
  • Heavstal Tech Platform:

Made with ❤️ by Heavstal Tech

Back to Blog

관련 글

더 보기 »

🔑 OAuth를 5살 아이에게 설명하듯이

Valet Key Analogy 당신은 고급 레스토랑에 가서 직접 주차장을 찾고 싶지 않습니다. 발레 파가 차 열쇠를 요구하지만, 그들이 차 문을 열어버릴까 봐 걱정됩니다.

eslint-plugin-pg 시작하기

빠른 설치 bash npm install --save-dev eslint-plugin-pg Flat Config js // eslint.config.js import pg from 'eslint-plugin-pg'; export default pg.configs.reco...