Heavstal Auth Provider
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: https://www.npmjs.com/package/heavstal-auth
📂 GitHub: https://github.com/Promise818/heavstal-auth
📦 Installation
npm install heavstal-auth
# or
yarn add heavstal-auth
# or
pnpm add heavstal-auth
Note: You must have
next-authinstalled in your project.
🚀 Usage
1. Get your credentials
Go to the Heavstal Developer Console and create a new application to get your Client ID and Client Secret.
2. Add environment variables
Add these to your .env or .env.local file:
HEAVSTAL_CLIENT_ID=ht_id_xxxxxxxxxxxx
HEAVSTAL_CLIENT_SECRET=ht_secret_xxxxxxxxxxxx
3. Configure NextAuth
Import HeavstalProvider and add it to your providers list. It works exactly like the built-in Google or GitHub providers.
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 support
This package is written in TypeScript and includes type definitions out of the box.
The Heavstal user profile includes:
idnameemailimage
⚙️ How it works
Under the hood, this provider pre-configures:
-
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. No OIDC discovery hassle.
🔗 Links
- Heavstal Developer Console: https://heavstal-tech.vercel.app/oauth/apps
- OAuth Documentation: https://heavstal-tech.vercel.app/docs/api/oauth-guide
- Heavstal Tech Platform: https://heavstal-tech.vercel.app
Made with ❤️ by Heavstal Tech

Top comments (0)