React Integration - Basic Setup
Learn how to integrate Bloque Payments into your React application using the BloqueCheckout component.
Installation
Install the React components package:
How It Works
The BloqueCheckout component renders an iframe with the Bloque hosted checkout page. The flow is:
SDK Initialization
Before using the BloqueCheckout component, initialize the SDK with your Public API Key:
Public API Key
Use your Public API Key to initialize the SDK in the frontend. This key is safe to expose in client-side code. Your Secret API Key should only be used on the backend.
Basic Usage
Backend Setup
Create a checkout session on your backend using @bloque/payments:
Component Props
BloqueCheckout
AppearanceConfig
PaymentResult
PaymentMethod
Examples
With Custom Appearance
With Specific Payment Methods
With All Callbacks
Custom Styling
Framework-Specific Examples
Next.js App Router
Next.js Pages Router
TypeScript Support
The package includes full TypeScript definitions:
Next Steps
- Customization - Customize the UI
- Checkout API - Learn more about the Checkout API
- Webhooks - Handle payment notifications