Heavstal Auth — NextAuth Provider for Heavstal Tech
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-authmust be installed in your project.
Configuration
- Go to the Heavstal Developer Console and create a new application to obtain your Client ID and Client Secret.
- Add them to your environment file (
.envor.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:
idnameemailimage
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