Auth Core
Interfaces
Interfaces
CLIAuthConfig
CLI Authentication Service
Handles authentication for CLI and MCP clients via email + verification code flow. Designed for non-browser environments where tokens are persisted to disk.
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
serverUrl | string | Yes | |
domainId | string | Yes |
StoredAuth
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
accessToken | string | Yes | |
refreshToken | string | Yes | |
expiresAt | number | Yes | |
userId | string | Yes | |
email | string | Yes |
ServerProfile
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | Yes | |
url | string | Yes | |
domainId | string | Yes | |
auth | StoredAuth | undefined | No |
FlowstateConfig
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
version | string | Yes | |
activeServerId | string | undefined | No | |
servers | Record<string, ServerProfile> | Yes |
FilesystemStorageConfig
Configuration for filesystem storage adapter
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
dataDir | string | Yes | Directory path where auth data will be stored |
AuthStorageAdapter
Storage adapter interface for authentication data Implementations can use RxDB, PostgreSQL, filesystem, S3, etc.
StorageAdapterConfig
Configuration for storage adapters
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
domainId | string | Yes | |
version | number | undefined | No |
RxDBStorageConfig
Configuration for RxDB storage adapter
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
serverUrl | string | Yes | |
authToken | string | Yes | |
domainId | string | Yes | |
version | number | undefined | No |
ApiTokenModel
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
serviceAccountId | string | Yes | |
name | string | Yes | |
tokenHash | string | Yes | |
prefix | string | Yes | |
lastUsedAt | string | null | Yes | |
expiresAt | string | null | Yes | |
createdAt | string | Yes | |
revoked | boolean | Yes | |
domainId | string | undefined | No | |
orgId | string | Yes | |
extended | Record<string, any> | undefined | No | Extensible object for future schema additions |
AuthAccountModel
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
userId | string | Yes | |
type | "oauth" | "oidc" | Yes | |
provider | string | Yes | |
providerAccountId | string | Yes | |
refreshToken | string | null | Yes | |
accessToken | string | null | Yes | |
expiresAt | number | null | Yes | |
tokenType | string | null | Yes | |
scope | string | null | Yes | |
idToken | string | null | Yes | |
createdAt | string | Yes | |
updatedAt | string | Yes | |
domainId | string | undefined | No | |
extended | Record<string, any> | undefined | No | Extensible object for future schema additions |
AuthSessionModel
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
userId | string | Yes | |
expires | string | Yes | |
deviceInfo | { userAgent: string; ip: string; deviceId: string; platform: string | null; browser: string | null; location: string | null; } | null | Yes | |
createdAt | string | Yes | |
updatedAt | string | Yes | |
domainId | string | undefined | No | |
extended | Record<string, any> | undefined | No | Extensible object for future schema additions |
AuthUserModel
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
email | string | Yes | |
emailVerified | string | null | Yes | |
name | string | null | Yes | |
image | string | null | Yes | |
domainId | string | undefined | No | |
orgId | string | Yes | |
createdAt | string | Yes | |
updatedAt | string | Yes | |
trashed | boolean | Yes | |
extended | Record<string, any> | undefined | No | Extensible object for future schema additions |
AuthVerificationTokenModel
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
identifier | string | Yes | |
token | string | Yes | |
expires | string | Yes | |
type | "magic-link" | "email-code" | "sms-code" | Yes | |
createdAt | string | Yes | |
domainId | string | undefined | No | |
extended | Record<string, any> | undefined | No | Extensible object for future schema additions |
ServiceAccountModel
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | Yes | |
description | string | null | Yes | |
createdBy | string | Yes | |
orgId | string | Yes | |
domainId | string | undefined | No | |
scopes | string[] | Yes | |
active | boolean | Yes | |
createdAt | string | Yes | |
updatedAt | string | Yes | |
trashed | boolean | Yes | |
extended | Record<string, any> | undefined | No | Extensible object for future schema additions |
AccessTokenPayload
Access token payload structure
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | |
email | string | Yes | |
domainId | string | Yes | |
orgId | string | Yes | |
scopes | string[] | undefined | No |
RefreshTokenPayload
Refresh token payload structure
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | |
sessionId | string | Yes | |
domainId | string | Yes |
ServiceTokenPayload
Service token payload structure
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
sub | string | Yes | |
type | "service" | Yes | |
domainId | string | Yes | |
permissions | string[] | Yes | |
iat | number | Yes | |
exp | number | Yes |
CreateServiceTokenOptions
Options for creating a service token
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
serviceId | string | Yes | |
domainId | string | Yes | |
permissions | string[] | Yes | |
ttlSeconds | number | Yes |
TokenClaims
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
sub | string | Yes | |
email | string | Yes | |
domainId | string | Yes | |
orgId | string | Yes | |
roles | string[] | undefined | No |