Checkout Elements
Build an embedded checkout with secure payment fields and host-page contact and address forms.
Elements reads a checkout session, shows the payment methods enabled for that session, validates the form, and creates the payment. Card numbers and bank account numbers stay inside Bias-hosted iframes; your page only owns non-sensitive fields such as email and address.
Choose an integration
All three packages expose the same checkout components and use the same underlying custom elements.
| Package | Choose it for |
|---|---|
@biaspay/elements | HTML, vanilla JavaScript, Vue, Svelte, or another frontend stack. |
@biaspay/react | React 19 or later. |
@biaspay/solid | Solid applications. |
Svelte is bundled inside @biaspay/elements as its renderer; it is not a peer dependency or a separate public integration.
How checkout works
- Your server creates a checkout session with a secret API key.
- Your server returns only the session’s
client_secretto the browser. - The browser mounts one Elements provider and one payment surface.
- Elements validates the form, saves collected customer and address details, and creates the payment.
- The browser receives a completion signal. Your server receives a
checkout_session.completedevent and fulfills the order.
client_secretclient_secretThe browser completion callback is useful for navigation and confirmation UI. Treat the server event as the durable fulfillment signal.
What to build
Every Elements tree has:
- One provider, configured with a checkout-session client secret.
- Exactly one of
PaymentElement,CardElement, orUSBankAccountElement. - Optional
ContactElementand billing or shippingAddressElementcomponents. - A
SubmitButton, or your own control connected through the integration API.
Build an Elements checkout