Elements quickstart
Create a checkout session on your server, pass its client secret to the browser, and mount the integration for your frontend.
1. Create a checkout session
Install the TypeScript server SDK and create a session from a server route. Never put your Bias API key in browser code.
server.ts
The amount is in cents. payment_method_types determines which methods PaymentElement offers. See the checkout sessions API for line items, setup mode, shipping options, and the complete request shape.
2. Install a client package
@biaspay/react requires React 19 and a matching React DOM major. @biaspay/solid declares Solid as a peer dependency. Both framework packages install @biaspay/elements and @biaspay/sdk as runtime dependencies.
3. Render the form
Each example collects email, lets the session choose between enabled payment methods, and submits the payment.
Pass Solid’s clientSecret as a string expression, not an accessor. Values returned by Solid hooks are accessors where they can change.
4. Fulfill the order on your server
Listen for checkout_session.completed with the event stream. Make fulfillment idempotent because delivery may be retried. The browser’s onComplete callback or biascomplete event is not a durable server signal.
Next steps
- Compose and style the form.
- Connect custom controls to Elements state.
- Read the package reference for web components, React, or Solid.