Skip to documentation
Developers
Dashboard ↗
Documentation / Integrations
Sandbox Only

React integration

Redirect from a browser button; create authenticated requests on your server.

Build in sandbox. These guides describe the current implementation. Live payments and payouts are disabled; planned capabilities are labelled explicitly.

A small client component

javascript
import { useState } from 'react';
export function BuyButton() {
  const [busy, setBusy] = useState(false);
  const [error, setError] = useState('');
  return <><button disabled={busy} onClick={async () => {
    setBusy(true); setError('');
    try {
      const response = await fetch('/api/checkout', { method: 'POST' });
      if (!response.ok) throw new Error('Please try again.');
      const { checkoutUrl } = await response.json();
      const url = new URL(checkoutUrl);
      if (url.origin !== 'https://merchant.unalaunch.com') throw new Error('Invalid checkout destination');
      window.location.assign(url.href);
    } catch { setError('Checkout unavailable. Please try again.'); setBusy(false); }
  }}>Start sandbox checkout</button>{error && <p role="alert">{error}</p>}</>;
}

Pair with the Next.js or JavaScript server guide

The /api/checkout example above is your application route, not a new Una Launch endpoint. Your server sends the secret and the configured product ID. A plain anchor to the hosted product link is an even simpler no-code alternative.