@meistrari/auth-core
v1.43.0
Published
A TypeScript/JavaScript SDK for interacting with the Auth API service.
Downloads
18,976
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
- OAuth Client Credentials Grant for service accounts
- Organization-scoped application token caching, renewal, and retry handling
- 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)Guides
- Client Credentials Grant — server-to-server authentication using the recommended
ApplicationTokenStoragehelper
API Reference
See it on Pantry
