Heavstal Auth — NextAuth Provider for Heavstal Tech

Published: (December 29, 2025 at 03:40 PM EST)
1 min read
Source: Dev.to

Source: Dev.to

Overview

The official NextAuth.js (Auth.js) provider for Heavstal Tech.
Easily integrate “Sign in with Heavstal” into your Next.js applications without manually configuring authorization URLs, token endpoints, or user profile mappings.

  • 📦 npm:
  • 📂 GitHub:

Installation

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

Note: next-auth must be installed in your project.

Configuration

  1. Go to the Heavstal Developer Console and create a new application to obtain your Client ID and Client Secret.
  2. Add them to your environment file (.env or .env.local):
HEAVSTAL_CLIENT_ID=ht_id_xxxxxxxxxxxx
HEAVSTAL_CLIENT_SECRET=ht_secret_xxxxxxxxxxxx

Usage

Add the provider to your NextAuth configuration.

// 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 };

The package is written in TypeScript and includes type definitions out of the box.

Provider Details

The Heavstal user profile includes:

  • 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

No manual endpoint setup or OIDC discovery is required.

Resources

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

Made with ❤️ by Heavstal Tech

Back to Blog

Related posts

Read more »

🔑 OAuth Explained Like You're 5

Valet Key Analogy You go to a fancy restaurant and don’t want to find parking yourself. The valet asks for your car key, but you’re worried they might open the...

Getting Started with eslint-plugin-pg

Quick Install 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...