Skip to content

Auth-Kit-JSUniversal Authentication for JavaScript

Secure, type-safe, and tree-shakeable authentication library

Auth-Kit-JS

Quick Example

typescript
import { createAuthRouter } from "auth-kit-js/express";

const authRouter = createAuthRouter({
  google: {
    clientId: process.env.GOOGLE_CLIENT_ID,
    clientSecret: process.env.GOOGLE_CLIENT_SECRET,
    redirectUri: "http://localhost:3000/auth/google/callback",
  },
  telegram: {
    botToken: process.env.TELEGRAM_BOT_TOKEN,
  },
  async onLogin(profile) {
    // User authenticated!
    return { token: generateToken(profile) };
  },
});

app.use("/auth", authRouter);

Released under the MIT License.