orgbyte-auth-js
v0.2.2
Published
Framework-agnostic core SDK for Authlab API-first authentication
Readme
orgbyte-auth-js
Framework-agnostic core SDK for Orgbyte Auth (API-first authentication).
Install
npm install orgbyte-auth-jsUsage
import { Auth } from "orgbyte-auth-js";
const auth = new Auth({
baseUrl: "https://your-orgbyte-backend.com",
apiKey: "pk_xxx",
redirectUri: "https://yourapp.com/auth/callback",
});
// Redirect-based login/register
auth.loginWithRedirect();
auth.registerWithRedirect();
// Handle callback (exchange code for token)
const { accessToken, user } = await auth.handleRedirectCallback(url, redirectUri);
// Get current user (GET /api/v1/auth/me)
const currentUser = await auth.user.getMe();
// Logout (clear token)
auth.logout();License
MIT
