Overview
Overview
Key Features
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
Architecture
1. Full Payment Flow
2. Individual Components
Component
Description
Next Steps
AuthenticationGetting StartedPayment FlowComponentsThemingLast updated
Was this helpful?
