Interface AuthInterface

Authentication interface for the Mosaia SDK

This interface defines the authentication options available when initializing the Mosaia SDK client. It includes authentication settings, API endpoints, and optional context parameters.

const auth: AuthInterface = {
grant_type: 'password',
email: 'john.doe@example.com',
password: 'password123'
};
// Client credentials flow
const auth: AuthInterface = {
grant_type: 'client',
client_id: 'client-id',
client_secret: 'client-secret'
};

// Refresh token flow
const auth: AuthInterface = {
grant_type: 'refresh',
refresh_token: 'refresh-token-here'
};
interface AuthInterface {
    grant_type: "password" | "client" | "refresh";
    email?: string;
    password?: string;
    client_id?: string;
    client_secret?: string;
    refresh_token?: string;
    code?: string;
    code_verifier?: string;
}

Properties

grant_type: "password" | "client" | "refresh"

Type of authentication grant

email?: string

User email (required for password grant)

password?: string

User password (required for password grant)

client_id?: string

OAuth client ID (required for client grant)

client_secret?: string

OAuth client secret (required for client grant)

refresh_token?: string

Refresh token (required for refresh grant)

code?: string

Authorization code (for OAuth code exchange)

code_verifier?: string

PKCE code verifier (for OAuth PKCE flow)