ObjectStackObjectStack

Auth Endpoints

Auth Endpoints protocol schemas

Authentication Endpoint Specification

Defines the canonical HTTP endpoints for the authentication service.

Based on better-auth v1.4.18 endpoint conventions.

NOTE: ObjectStack's auth implementation uses better-auth library which has

established endpoint conventions. This spec documents those conventions as

the canonical API contract.

Source: packages/spec/src/api/auth-endpoints.zod.ts

TypeScript Usage

import { AuthEndpoint, AuthFeaturesConfig, AuthProviderInfo, DeviceRequestResponse, DeviceTokenResponse, EmailPasswordConfigPublic, GetAuthConfigResponse } from '@objectstack/spec/api';
import type { AuthEndpoint, AuthFeaturesConfig, AuthProviderInfo, DeviceRequestResponse, DeviceTokenResponse, EmailPasswordConfigPublic, GetAuthConfigResponse } from '@objectstack/spec/api';

// Validate data
const result = AuthEndpoint.parse(data);

AuthEndpoint

Properties

PropertyTypeRequiredDescription
signInEmailObject
signUpEmailObject
signOutObject
getSessionObject
forgetPasswordObject
resetPasswordObject
sendVerificationEmailObject
verifyEmailObject

AuthFeaturesConfig

Properties

PropertyTypeRequiredDescription
twoFactorbooleanTwo-factor authentication enabled
passkeysbooleanPasskey/WebAuthn support enabled
magicLinkbooleanMagic link login enabled
organizationbooleanMulti-tenant organization support enabled

AuthProviderInfo

Properties

PropertyTypeRequiredDescription
idstringProvider ID (e.g., google, github, microsoft, okta)
namestringDisplay name (e.g., Google, GitHub)
enabledbooleanWhether this provider is enabled
typeEnum<'social' | 'oidc'>Provider type

DeviceRequestResponse

Properties

PropertyTypeRequiredDescription
codestringShort-lived device code used for polling
verificationUrlstringURL the user should open in a browser
expiresAtstringISO timestamp when the code expires
intervalnumberRecommended polling interval in seconds

DeviceTokenResponse

Union Options

This schema accepts one of the following structures:

Option 1

Properties

PropertyTypeRequiredDescription
statusstring

Option 2

Properties

PropertyTypeRequiredDescription
statusstring
tokenstringBearer token to store in credentials file
userObject

Option 3

Properties

PropertyTypeRequiredDescription
statusstring


EmailPasswordConfigPublic

Properties

PropertyTypeRequiredDescription
enabledbooleanWhether email/password auth is enabled
disableSignUpbooleanoptionalWhether new user registration is disabled
requireEmailVerificationbooleanoptionalWhether email verification is required

GetAuthConfigResponse

Properties

PropertyTypeRequiredDescription
emailPasswordObjectEmail/password authentication config
socialProvidersObject[]Available social/OAuth providers
featuresObjectEnabled authentication features

On this page