TryMellon
Navigation

Getting Started

Get started with TryMellon passwordless authentication and the JavaScript SDK.

Getting Started

Add passkey login to your existing auth stack. No migration. No new user model.


Try it now — no account needed

Run this in any project. No dashboard, no credentials, no WebAuthn prompt:

npm install @trymellon/js
import { TryMellon } from '@trymellon/js'

// sandbox: true — works instantly, no account required
const client = TryMellon.create({
  appId: 'sandbox',
  publishableKey: 'sandbox',
  sandbox: true,
}).value!

const result = await client.signUp({ externalUserId: 'user_123' })
console.log(result.value?.sessionToken) // → 'trymellon_sandbox_token'

That’s it. Passkey register + session token in 3 lines. When you’re ready for production, swap sandbox: true for real credentials.

Sandbox mode returns a fixed token instantly — no API calls, no WebAuthn ceremony, no HTTPS required. Full sandbox docs →


What TryMellon does (and doesn’t do)

DoesDoesn’t
Handles the full WebAuthn browser flowCreate user sessions — your backend does
Returns a sessionToken your backend validatesReplace your auth system — it plugs into it
Cross-device QR login out of the boxStore end users or passwords
Email OTP fallback when WebAuthn unavailableTouch your existing user model

Production setup (5 minutes)

1. Get credentials

Go to dashboard → Create app → Add your origin to Allowed origins → copy App ID and Client ID.

2. Initialize the client

import { TryMellon } from '@trymellon/js'

const clientResult = TryMellon.create({
  appId: 'your-app-id',        // UUID from dashboard
  publishableKey: 'cli_xxxx',  // Client ID from dashboard
})

if (!clientResult.ok) throw clientResult.error
const client = clientResult.value

3. Register a passkey

const result = await client.signUp({ externalUserId: 'user_123' })
if (result.ok) {
  // Send result.value.sessionToken to your backend
}

4. Authenticate a returning user

const result = await client.signIn({ externalUserId: 'user_123' })
if (result.ok) {
  // Send result.value.sessionToken to your backend
}

5. Validate on your backend

// Your backend — Node.js example
const res = await fetch('https://api.trymellonauth.com/v1/sessions/validate', {
  headers: { Authorization: `Bearer ${sessionToken}` },
})
const { valid, externalUserId } = await res.json()
if (valid) {
  // Create your own session/cookie here
}

Full backend patterns → Backend validation


Requirements

BrowserChrome, Safari, Firefox, Edge (WebAuthn support)
HTTPSRequired in production — localhost works for dev
AccountFree — create one here

Next steps

Sandbox modeBuild your UI before creating an account
Register & AuthenticateFull options and error handling
Backend validationValidate session tokens server-side
Cross-device QRDesktop → mobile login flow
API ReferenceComplete SDK reference