Services Module

Complete API reference for sso.services module - service management, subscription plans, API keys, SAML 2.0 Identity Provider, and Billing.

AuthOS release 0.8.5 TypeScript SDK 0.8.0 Latest-only documentation
Updated Jul 15, 2026
On this page

The services module (sso.services) manages applications (services), subscription plans, API keys for service-to-service authentication, AuthOS SAML 2.0 Identity Provider functionality, and billing checkouts.

Core Service Methods

sso.services.create()

Signature:

create(orgSlug: string, payload: CreateServicePayload): Promise<CreateServiceResponse>

Description: Create a new service for an organization. Returns the service details including the client_id and the one-time client_secret.


sso.services.list()

Signature:

list(orgSlug: string): Promise<ServiceListResponse>

Description: List all services for an organization with usage metadata and counts.


sso.services.get()

Signature:

get(orgSlug: string, serviceSlug: string): Promise<Service>

Description: Get detailed configuration for a specific service.


sso.services.update() | delete()

Standard update and delete operations for services.

sso.services.rotateSecret()

Signature:

rotateSecret(orgSlug: string, serviceSlug: string): Promise<RotateServiceSecretResponse>

Description: Rotate a service client secret. The returned client_secret is only shown once and should be persisted by the caller immediately.

Example:

const rotated = await sso.services.rotateSecret('acme-corp', 'main-app');
console.log(rotated.service.client_id);
console.log(rotated.client_secret); // Save this immediately

Plans Module

Managed via sso.services.plans.

sso.services.plans.list() | create() | update() | delete()

Manage subscription plans for your services.


API Keys Module

Managed via sso.services.apiKeys.

sso.services.apiKeys.create()

Signature:

apiKeys.create(orgSlug: string, serviceSlug: string, payload: CreateApiKeyPayload): Promise<ApiKeyCreateResponse>

Description: Create a new API key. The full key is only returned once.


sso.services.apiKeys.list() | get() | delete()

Manage existing API keys.


SAML Module (Identity Provider)

Managed via sso.services.saml.

sso.services.saml.configure() | getConfig() | deleteConfig()

Configure AuthOS as a SAML Identity Provider for third-party apps.

sso.services.saml.initiateLogin()

Signature:

saml.initiateLogin(orgSlug: string, serviceSlug: string): Promise<string>

Description: Returns an HTML page with an auto-submitting form for IdP-initiated SSO.


sso.services.saml.generateCertificate() | getCertificate()

Manage SAML signing certificates.


Billing Module

Managed via sso.services.billing.

sso.services.billing.createCheckout()

Signature:

billing.createCheckout(orgSlug: string, serviceSlug: string, payload: CreateCheckoutPayload): Promise<CreateCheckoutResponse>

Description: Create a Stripe checkout session for an end-user to subscribe to a service plan.


Type Definitions

Refer to sso-sdk/src/types for complete interface definitions.