Skip to main content

Overview

This guide will help you integrate BOOP authentication into your existing payment or access control system. What you’ll need:
  • Your vendor credentials (provided by BOOP)
  • Basic programming knowledge
  • 30 minutes

Step 1: Get Your Credentials

Contact our sales team to get your vendor credentials:
Vendor ID: ven_your_unique_id
API Key: sk_live_your_secret_key
Keep your API key secret. Never expose it in client-side code or public repositories.

Step 2: Install SDK

Choose your language and install the BOOP SDK:
npm install @boop/vendor-sdk

Step 3: Initialize Client

Set up the BOOP client in your backend:
const { BoopClient } = require('@boop/vendor-sdk');

const boop = new BoopClient({
  vendorId: process.env.BOOP_VENDOR_ID,
  apiKey: process.env.BOOP_API_KEY,
  environment: 'production' // or 'sandbox' for testing
});

// Test connection
await boop.testConnection();

Step 4: Create Authentication Request

When a customer wants to pay or access your service:
// Payment authentication
async function processPayment(amount) {
  try {
    // Create authentication context
    const auth = await boop.createAuthentication({
      type: 'payment',
      amount: amount,
      currency: 'USD',
      reference: 'ORDER-12345',
      requiredAttributes: ['email'] // Request customer email
    });

    // Wait for customer to scan palm
    console.log(`Waiting for palm scan... (timeout in ${auth.timeout}s)`);

    // Get result (this waits for scan or timeout)
    const result = await auth.waitForResult();

    if (result.authenticated) {
      console.log('Payment authorized!');
      console.log('Customer ID:', result.userId);
      console.log('Email:', result.attributes.email);

      // Process the payment in your system
      return processPaymentInYourSystem(result.userId, amount);
    } else {
      console.log('Authentication failed:', result.error);
      return false;
    }

  } catch (error) {
    console.error('Error:', error);
    return false;
  }
}

Step 5: Handle the Response

After authentication, you’ll receive:
{
  "authenticated": true,
  "userId": "usr_abc123def456",
  "attributes": {
    "email": "customer@example.com"
  },
  "timestamp": "2024-01-15T10:30:00Z",
  "reference": "ORDER-12345"
}
Use this to:
  • Complete the transaction
  • Store the user ID for future reference
  • Send receipts to the provided email

Complete Integration Example

Here’s a full example for a point-of-sale system:
const express = require('express');
const { BoopClient } = require('@boop/vendor-sdk');

const app = express();
const boop = new BoopClient({
  vendorId: process.env.BOOP_VENDOR_ID,
  apiKey: process.env.BOOP_API_KEY
});

// Endpoint your POS calls
app.post('/checkout', async (req, res) => {
  const { amount, items } = req.body;

  try {
    // Create BOOP authentication
    const auth = await boop.createAuthentication({
      type: 'payment',
      amount: amount,
      reference: `POS-${Date.now()}`
    });

    // Return auth ID to POS
    res.json({
      authId: auth.id,
      message: 'Please scan palm on reader'
    });

    // Wait for result in background
    auth.waitForResult().then(result => {
      if (result.authenticated) {
        // Process payment
        completePayment(result.userId, amount, items);
        // Update POS display
        notifyPOS('Payment successful!');
      }
    });

  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

app.listen(3000);

Testing Your Integration

Sandbox Environment

Use sandbox credentials to test without real palm scans:
const boop = new BoopClient({
  vendorId: 'ven_test_abc123',
  apiKey: 'sk_test_xyz789',
  environment: 'sandbox'
});

// Force specific test scenarios
const auth = await boop.createAuthentication({
  type: 'payment',
  amount: 2500,
  testMode: 'immediate_success' // or 'immediate_failure', 'timeout'
});

Test Scenarios

Test these scenarios in sandbox:
Test ModeResult
immediate_successReturns success immediately
immediate_failureReturns auth failure
timeoutWaits full timeout period
insufficient_attributesSuccess but missing attributes
network_errorSimulates connection issues

Going Live

Pre-Launch Checklist

  • Replace sandbox credentials with production
  • Implement error handling
  • Add logging for debugging
  • Test timeout scenarios
  • Implement retry logic

Launch Day

  1. Start in shadow mode: Log authentications but don’t block transactions
  2. Gradual rollout: Enable for staff first, then loyal customers
  3. Monitor closely: Watch success rates and response times
  4. Have support ready: BOOP support team is available 24/7

Common Integration Patterns

Loyalty Programs

const auth = await boop.createAuthentication({
  type: 'loyalty_lookup',
  requiredAttributes: ['loyalty_tier', 'point_balance']
});

if (result.authenticated) {
  applyLoyaltyDiscount(result.attributes.loyalty_tier);
  displayPoints(result.attributes.point_balance);
}

Access Control

const auth = await boop.createAuthentication({
  type: 'access',
  location: 'gym_entrance',
  requiredAttributes: ['membership_status', 'membership_expiry']
});

if (result.authenticated && result.attributes.membership_status === 'active') {
  unlockDoor();
}

Age Verification

const auth = await boop.createAuthentication({
  type: 'age_verification',
  minimumAge: 21,
  requiredAttributes: ['age_verified']
});

if (result.authenticated && result.attributes.age_verified) {
  allowPurchase();
}

Get Help

Next Steps