@drmhse/sso-sdk
v0.5.2
Published
Zero-dependency TypeScript SDK for AuthOS, the multi-tenant authentication platform
Maintainers
Readme
@drmhse/sso-sdk
Core TypeScript SDK for AuthOS. It handles authentication flows, session persistence, token refresh, and the multi-tenant API surface used by the framework adapters.
Full documentation: authos.dev/docs/sdk/
AI agent skills: authos.dev/docs/ai-agent-skills/ and github.com/drmhse/authos_skill
Install
npm install @drmhse/sso-sdkQuick start
import { SsoClient } from '@drmhse/sso-sdk';
const sso = new SsoClient({
baseURL: 'https://sso.example.com',
});
await sso.auth.login({
email: '[email protected]',
password: 'SecurePass123!',
org_slug: 'acme-corp',
service_slug: 'main-app',
});
const profile = await sso.user.getProfile();
console.log(profile.email);Common usage modes
Platform administration
Use only baseURL when acting as a platform owner or admin tool:
const sso = new SsoClient({ baseURL: 'https://sso.example.com' });Tenant application
Pass organization and service context when you need hosted auth, BYOO, or service-scoped tokens:
const loginUrl = sso.auth.getLoginUrl('github', {
org: 'acme-corp',
service: 'main-app',
redirect_uri: 'https://app.acme.com/callback',
});Hosted auth context
const context = await sso.auth.getContext({
org: 'acme-corp',
service: 'main-app',
redirect_uri: 'https://app.acme.com/callback',
});Provider token handoff
const result = await sso.serviceApi.requestProviderToken({
user_id: 'user-id',
provider: 'github',
scopes: ['repo'],
});Feature highlights
- Password, OAuth, magic-link, passkey, MFA, and device-flow authentication
- Hosted auth context for login surfaces
- Linked accounts and provider-token request completion flows
- Organization, service, analytics, audit-log, and platform-owner APIs
- Service API helpers including backend-only provider token retrieval
Canonical references
- SDK getting started: authos.dev/docs/sdk/getting-started/
- SDK reference: authos.dev/docs/sdk/reference/
- API reference: authos.dev/docs/api/reference/
