Before you begin, make sure you have your App ID from the Dashboard. Once you have this, you're ready to integrate TrulyYou into your application.

I am integrating authentication on frontend, verifying signatures on backend.

1 Frontend Integration
2 Backend Integration

Install the SDK

Terminal
npm install @trulyyou/web-sdk

Initialize the SDK

JavaScript
import { TrulyYouSDK } from '@trulyyou/web-sdk';

const sdk = new TrulyYouSDK({
  appId: 'your_app_id_from_dashboard'
});

Authenticate Requests

JavaScript
// Authenticate a payment
const response = await sdk.fetchWithSignature('/api/payment', {
  method: 'POST',
  body: JSON.stringify({
    amount: 100.00,
    recipient: 'alice@bank.com'
  })
});

if (response.ok) {
  const data = await response.json();
  console.log('Payment successful:', data);
}