# Legacy Web SDK (Archived)

The GlomoPay web checkout was previously delivered as separate per-flow SDKs. These have been superseded by the single **[Unified SDK](/product-guide/sdk/unified-sdk)** (`GlomoCheckoutApi` from `https://unified-sdk.glomopay.com/index.js`), which auto-detects the order type (standard, LRS, subscription). New integrations must use the Unified SDK.

The snippets below document the older SDKs for reference by existing integrations. They are functionally frozen.

## Legacy Checkout SDK (standard payments & subscriptions)

Loaded from `https://glomopay-checkout-sdk.web.app/index.js`, exposing `GlomoCheckoutApi`:

```html
<script type="module">
  import { GlomoCheckoutApi } from 'https://glomopay-checkout-sdk.web.app/index.js';

  const checkout = new GlomoCheckoutApi({
    publicKey: 'live_xxx',
    orderId: 'order_xxx', // or subscriptionId for subscriptions
  });

  checkout.on('payment.success', (response) => { /* ... */ });
  checkout.on('payment.failure', (response) => { /* ... */ });
  checkout.on('checkout.closed', () => { /* ... */ });

  checkout.open();
</script>
```

**Migrating to the Unified SDK:** change the import to `https://unified-sdk.glomopay.com/index.js`. The `GlomoCheckoutApi` constructor and events are unchanged — see the [Unified SDK reference](/product-guide/sdk/unified-sdk). Note one behavioural difference: with the Unified SDK, setting `callbackUrl` makes it **only** redirect (it does not also emit `.on()` events), whereas the legacy checkout SDK did both.

## Legacy LRS SDK

Loaded from `https://lrs-checkout-sdk-prod.web.app/index.js`, exposing `LrsCheckoutApi`:

```html
<script type="module">
  import { LrsCheckoutApi } from 'https://lrs-checkout-sdk-prod.web.app/index.js';

  const lrsCheckout = new LrsCheckoutApi({
    publicKey: 'live_xxx',
    orderId: 'order_xxx',
  });

  lrsCheckout.on('payment.success', (data) => { /* ... */ });
  lrsCheckout.on('payment.failure', (data) => { /* ... */ });
  lrsCheckout.on('checkout.closed', () => { /* ... */ });

  await lrsCheckout.open();
</script>
```

**Migrating to the Unified SDK:** the Unified SDK handles LRS through the same `GlomoCheckoutApi`, so a separate `LrsCheckoutApi` is no longer needed. Change the import to `https://unified-sdk.glomopay.com/index.js` and use `GlomoCheckoutApi`; the events are unchanged. (Note: the legacy LRS SDK emits `checkout.closed` — an earlier version of the LRS guide showed a `close` event, which never actually fired.) See the [Unified SDK reference](/product-guide/sdk/unified-sdk).