Quick Start

Get started with AffirmID in minutes. Install our SDK, configure your API key, and start sending authentication requests.

1. Get your API key

Create an API key in your dashboard under Settings → API Keys.

2. Install the SDK

npm install @affirmid/sdk

3. Send your first request

Use the example code to create an authentication request.

example.ts
// Initialize the AffirmID client
import { AffirmID } from '@affirmid/sdk';

const client = new AffirmID({
  apiKey: process.env.AFFIRMID_API_KEY
});

// Create an authentication request
const authRequest = await client.mfa.createRequest({
  userId: 'user_123',
  type: 'push',
  message: 'Login to Acme App'
});

// Poll for response or use webhooks
const result = await client.mfa.waitForResponse(
  authRequest.id,
  { timeout: 60000 }
);

if (result.status === 'approved') {
  // User approved the request
  console.log('Authentication successful!');
}

Authentication

API Key Authentication

All API requests require authentication using an API key passed in theX-API-Key header.

curl -H "X-API-Key: your_api_key" https://api.affirmid.com/v1/mfa/request

Endpoints

POST/api/v1/mfa/request

Create a new authentication request

GET/api/v1/mfa/request/:id

Get the status of an authentication request

POST/api/v1/mfa/verify

Verify a TOTP code

GET/api/v1/users/:id

Get user details

POST/api/v1/identity/verify

Request identity verification

GET/api/v1/identity/attestation/:id

Get device attestation status

Official SDKs

🟨

JavaScript

v2.4.0

🐍

Python

v2.4.0

🟩

Node.js

v2.4.0

🐹

Go

v2.4.0

💎

Ruby

v2.4.0

🐘

PHP

v2.4.0

Need help integrating?

Our developer support team is here to help you build secure authentication into your applications.