Node.js Quick Start
Add the optional Node backend pieces for an embedded FloPayCheckout integration.
Node.js Quick Start
For the recommended embedded flow, the browser creates the checkout session inline through FloPayCheckout createSession. You do not need a Node endpoint just to create a session ahead of time.
Use @flopay/node when you need server-side responsibilities such as:
- Verifying Flo webhook deliveries
- Fulfilling orders or activating subscriptions after payment
- Managing customers
- Supporting an older hosted/session-ID-based flow
If you're following the React Quick Start, webhook verification is usually the first backend step to add. Session creation can stay on the client.
1. Configure Secrets
2. Initialize the SDK
3. Verify Webhooks
Read the webhook request body as raw text (request.text()), not parsed JSON. Signature verification requires the original bytes.
4. How It Fits the Embedded Flow
- Your React app renders
FloPayCheckoutwithcreateSession - The component creates the billing session directly and renders the embedded payment form
- The customer completes payment on the page
- Flo sends a webhook to your Node endpoint
- Your server fulfills the order and records the final payment state
5. Need Server-Created Sessions?
If you still want a pre-created session or hosted redirect flow, @flopay/node still supports it:
That flow still works, but it is no longer the main quick-start path for embedded checkout.
Next Steps
- React Quick Start — embed checkout inline with
createSession - Webhooks — full webhook handling examples
- FloPayCheckout Guide — embedded checkout options
- Node API Reference — all server-side methods