@meistrari/auth-core
v1.20.0
Published
A TypeScript/JavaScript SDK for interacting with the Auth API service.
Maintainers
Keywords
Readme
@meistrari/auth-core
A TypeScript/JavaScript SDK for interacting with the Auth API service.
Features
- Multiple Authentication Methods
- Social providers (Google, Microsoft)
- SAML-based SSO
- Email and password
- Organization Management
- Multi-tenant support
- Role-based access control (RBAC)
- Team management
- Member invitations
- JWT Token Validation
- Application Authentication
- OAuth PKCE application flows
- OAuth Device Authorization Grant endpoints
- Application token refresh, logout, and organization switching
- API Keys
- User-scoped API key CRUD
- Active-organization API key listing
Installation
bun add @meistrari/auth-coreQuick Start
import { AuthClient } from '@meistrari/auth-core'
// Initialize the client
const authClient = new AuthClient('https://auth.example.com')
// Sign in with email and password
await authClient.session.signInWithEmailAndPassword({
email: '[email protected]',
password: 'SecurePassword123!'
})
// List user's organizations
const organizations = await authClient.organization.listOrganizations()
console.log('Organizations:', organizations)
// Application auth helpers
const { code } = await authClient.application.startAuthorizationFlow(
'application-id',
'https://your-app.com/auth/callback',
'pkce-code-challenge',
'organization-id',
)
const tokens = await authClient.application.completeAuthorizationFlow(code, 'pkce-code-verifier')
console.log('Application user:', tokens.user.email)API Reference
See it on Pantry
