Skip to main content
@lynqpay/checkout-sdk embeds the Lynq-hosted payment form in your page. Your application controls where Checkout appears and how the surrounding page responds; Lynq controls the payment form, authentication, redirects, and its height.

npm installation

The npm package is ESM-only and includes TypeScript declarations and API documentation for editor autocomplete.

Script-tag installation

If you do not use a bundler, load the IIFE bundle with a classic script tag. Pin the exact released version so an unrelated future release cannot change production checkout without your deployment.
The classic script exposes window.Lynq.
Do not use a floating URL such as @latest in production.

Create Checkout

Create one instance after your server returns a Payment Intent client secret.

Mount Checkout

The mount target may be a CSS selector or an HTMLElement.
Mounting inserts an iframe and starts a handshake with hosted Checkout. onReady fires when the form is visible and ready for customer input. Checkout automatically resizes the iframe as its hosted content changes. Do not set the iframe height or listen for internal messages yourself.

Lifecycle and cleanup

Only one Lynq Checkout may be mounted on a page at once. Call destroy() when a component unmounts or the customer leaves the payment step. Create a new instance for the next Payment Intent.
isReady() and isValid() describe UI state. Neither confirms that a payment completed.

Layout and accessibility

  • Give the mount container enough width for your checkout layout; the iframe height is managed automatically.
  • Keep a visible page heading that identifies the payment step.
  • Show a loading placeholder until onReady fires.
  • Display onCheckoutError messages in an accessible alert region.
  • Do not place a second interactive payment form over the Checkout iframe.

Server-rendered applications

The package can be imported by an SSR application, but Checkout can only be constructed in a browser. Constructing it while window or document is unavailable throws ConfigError. For React, construct Checkout inside an effect or client-only component and destroy it in the cleanup function:
Make clientSecret stable for the lifetime of that component. If it changes, destroy the old instance before creating a new one. Next, implement Checkout events and outcomes.
Last modified on August 10, 2026