Overview

Overview

The Alternative Payments Web SDK (@getalternative/partner-sdk) provides pre-built, embeddable UI components for collecting payments in web applications. It handles the complete payment flow including invoice display, payment method management, and secure card collection.


Key Features

  • Pre-built UI Components - Drop-in components for invoices, payment methods, and checkout

  • Full Payment Flow - Orchestrated end-to-end payment experience

  • PCI Compliance - Secure card collection via Evervault (no PCI scope for your app)

  • ACH Support - Bank account collection

  • Customizable Theming - Match your brand colors and styling

  • TypeScript Support - Full type definitions included

  • Secure Authentication - Token-based auth keeps credentials on your server


Quick Example

import { AlternativeClient } from '@getalternative/partner-sdk';

// Token is generated by your backend (keeps credentials secure)
const client = await AlternativeClient.create({
  accessToken: tokenFromYourBackend,
  environment: 'production',
  onAccessTokenExpired: async () => {
    // Fetch new token from your backend when expired
    const response = await fetch('/api/checkout-token');
    const { token } = await response.json();
    return token;
  },
});

// Create a full payment flow
const flow = client.createPaymentFlow({
  containerId: 'payment-container',
  onPaymentSuccess: (payment) => {
    console.log('Payment successful:', payment.id);
  },
});

Installation

Or with yarn:

Or with pnpm:

Last updated

Was this helpful?