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)
| Does | Doesn’t |
|---|---|
| Handles the full WebAuthn browser flow | Create user sessions — your backend does |
Returns a sessionToken your backend validates | Replace your auth system — it plugs into it |
| Cross-device QR login out of the box | Store end users or passwords |
| Email OTP fallback when WebAuthn unavailable | Touch 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
| Browser | Chrome, Safari, Firefox, Edge (WebAuthn support) |
| HTTPS | Required in production — localhost works for dev |
| Account | Free — create one here |
Next steps
| Sandbox mode | Build your UI before creating an account |
| Register & Authenticate | Full options and error handling |
| Backend validation | Validate session tokens server-side |
| Cross-device QR | Desktop → mobile login flow |
| API Reference | Complete SDK reference |