Get Started with AffirmID
Set up your account and make your first authentication request in under 5 minutes.
Prerequisites
- Node.js 18+, Python 3.8+, or Go 1.19+
- A backend server that can make HTTPS requests
- Users with the AffirmID mobile app installed
Create an Account
Sign up for a free AffirmID developer account to get started.
Visit our signup page and create your developer account. You'll get immediate access to:
- 10,000 free authentications/month
- Full API access
- Test environment
- Developer dashboard
Get Your API Key
Generate an API key from your dashboard to authenticate requests.
After signing in, navigate to Settings → API Keys in your dashboard and create a new key.
Important: Store your API key securely. It will only be shown once during creation. Never expose it in client-side code or public repositories.
AFFIRMID_API_KEY=affirmid_live_xxxxxxxxxxxxxxxxInstall the SDK
Add our official SDK to your project using your package manager.
Choose your preferred language and install the SDK:
npm install @affirmid/nodepip install affirmidgo get github.com/affirmid/affirmid-goMake Your First Request
Initialize the client and create an authentication request.
Here's a complete example to send a push authentication request:
import { AffirmID } from '@affirmid/node';
// Initialize with your API key
const affirmid = new AffirmID({
apiKey: process.env.AFFIRMID_API_KEY
});
// Create an authentication request
async function authenticateUser(userId: string, ip: string) {
const request = await affirmid.auth.create({
userId: userId,
application: 'My App',
ipAddress: ip,
message: 'Login attempt from Chrome on Windows'
});
// Poll for the result (or use webhooks)
const result = await affirmid.auth.waitForResult(request.id, {
timeout: 60000 // 60 second timeout
});
return result.decision; // 'approved' | 'denied' | 'expired'
}