🔐
Multi-Provider Support
Google OAuth2/OIDC, Facebook OAuth2, and Telegram (WebApp + Login Widget) out of the box.
Secure, type-safe, and tree-shakeable authentication library
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);