TryMellon

Installation

Installation

Install from npm

npm install @trymellon/js

Initialize the client

import { TryMellon } from '@trymellon/js'

const client = new TryMellon({
  appId: 'app_live_xxxx',     // Required: application id from TreyMellon dashboard
  apiKey: 'key_live_xxxx',    // Required: API key for the application
  apiBaseUrl: 'https://api.trymellonauth.com', // Optional, default
  timeoutMs: 30000,           // Optional, default 30000
  maxRetries: 3,              // Optional, default 3
  retryDelayMs: 1000,         // Optional, default 1000
})

Configuration options

OptionRequiredDescription
appIdYesYour application id. Sent as X-App-Id header.
apiKeyYesAPI key for authentication. Sent as Authorization: Bearer <apiKey>.
apiBaseUrlNoAPI base URL. Default: 'https://api.trymellonauth.com'.
timeoutMsNoHTTP request timeout. Range 1000–300000. Default: 30000.
maxRetriesNoNumber of retries for network errors. Range 0–10. Default: 3.
retryDelayMsNoDelay between retries. Range 100–10000. Default: 1000.

For register and authenticate options you can use either externalUserId (camelCase, recommended) or external_user_id (snake_case); the SDK normalizes to snake_case for the API.