Skip to main content
FlareHQ provides three official client libraries so you can integrate USDC payments, escrow, streaming, and x402 access control into any stack — from TypeScript backends and Next.js frontends to Python microservices and AI agents. Choose the SDK that matches your environment, or combine them when you need both a server-side API client and embeddable UI components.

Installation

The @flarehq/sdk package is the primary SDK and the most feature-complete client. It targets Node.js 18+ and has full TypeScript typings.

Node.js / TypeScript SDK

The Node.js SDK is the recommended choice for server-side logic: creating checkout sessions, managing escrows, verifying webhooks, and deploying AI agents. Initialize a single shared client in your project and import it wherever you need it.
src/lib/flarehq.ts
Store your secret key only in server-side environment variables — never expose fhq_sec_... keys to the browser. Use your Publishable Key (fhq_pub_...) for any client-side initialization.

Create a checkout session

Once the client is initialized, creating a hosted checkout session is a single async call:
src/app/api/checkout/route.ts

React SDK

The React SDK builds on top of @flarehq/sdk to give you ready-made components for embedding payment flows directly in your UI. It handles loading states, error feedback, and wallet connection out of the box — so you can ship a checkout experience without building one from scratch.
src/components/CheckoutButton.tsx
The React SDK requires @flarehq/sdk as a peer dependency. If you are already using the Node.js SDK in the same project, no additional installation is needed.

Python SDK

Use flarehq-python for Python backends, data pipelines, and autonomous agents that need to create payment sessions, release escrows, or listen for on-chain events.
src/payments/checkout.py

SDK Capability Overview

Not every SDK surfaces every feature. Use this table to confirm the right library for your use case:
The React SDK is intentionally scoped to UI rendering. Server-side operations — escrow, streaming, webhooks, and x402 — must be handled from your backend using the Node.js or Python SDK.

Keeping Your SDKs Up to Date

FlareHQ ships updates to all three SDKs as new Arc testnet features become available. Run the following commands to pull the latest versions:
Breaking changes are signalled by a major version bump. Review the changelog before upgrading across a major version in production.

Next Steps

Webhooks

Receive real-time HTTP notifications for payment, escrow, and stream events.

Errors & Troubleshooting

Understand HTTP status codes and resolve common integration issues.

Hosted Checkout

Build a complete USDC checkout flow with the pre-built payment page.

Quickstart

Go from zero to your first on-chain payment in under five minutes.