Build with AffirmID
Everything you need to integrate secure authentication into your applications.
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/node
3. Send your first request
Use the example code to create an authentication request.
// Initialize the AffirmID client
import { AffirmID } from '@affirmid/node';
const client = new AffirmID({
apiKey: process.env.AFFIRMID_API_KEY
});
// Create an authentication request — this pushes to the
// user's registered devices
const authRequest = await client.auth.create({
userId: 'user_123',
context: {
application: 'Acme App',
ipAddress: req.ip,
},
});
// Poll for the response, or use webhooks instead
const result = await client.auth.waitForResult(
authRequest.id,
{ timeout: 60000 }
);
if (result.approved) {
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/api/v1/mfa/user/:userId/statusEndpoints
/api/v1/mfa/verify/pushSend a push approval request and create an auth request
/api/v1/mfa/status/:requestIdGet the status of an authentication request
/api/v1/mfa/verify/totpVerify a TOTP code
/api/v1/mfa/user/:userId/statusCheck which factors a user has enrolled
/api/v1/identity/verifyRequest identity verification
/api/v1/identity/status/:requestIdGet the status of an identity verification request
Official SDKs
Node.js
v1.0.0
Python
v1.0.0
Go
v1.0.0
Ruby
Coming soon
PHP
Coming soon
Java
Coming soon
Need help integrating?
Our developer support team is here to help you build secure authentication into your applications.