Getting Started
Get up and running with Bloque Payments in minutes. This guide will walk you through setting up both the frontend React component and the backend SDK.
Installation
Frontend (React)
Install the React components package:
Backend (Node.js/Bun)
Install the backend SDK:
API Key
To use Bloque Payments, you'll need an API key. You can obtain one from the Bloque Dashboard.
Bloque provides two types of API keys:
- Public API Key: Can be safely used in the client (frontend) to initialize the SDK.
- Secret API Key: Should only be used on the backend. Never expose it in client-side code. :::
How It Works
Quick Start: Complete Integration
Here's a complete example showing how to integrate Bloque Payments with React on the frontend and Node.js/Bun on the backend.
Backend Setup (Node.js/Bun)
First, create an endpoint to generate checkout sessions:
Frontend Setup (React)
Environment Variables
Create a .env file in your backend project:
Load them in your application:
Configuration Options
SDK Configuration (Backend)
Modes
sandbox: For testing and development. No real transactions.production: For live operations with real payments.
React Component Props
Appearance Configuration
Customize the look and feel:
:::tip Try the Playground Experiment with customization options in real-time in our interactive Playground.
TypeScript Support
The SDK is fully typed with TypeScript. Import types for better development experience:
Testing in Sandbox Mode
Use sandbox mode for testing without real transactions:
Test Card Numbers
Use these test card numbers in sandbox mode:
Next Steps
Now that you have basic integration working, explore more features:
- Playground - Experiment with the checkout in real-time
- React Integration - Detailed React setup guide
- Checkout API - Create hosted checkout pages
- Payment Methods - Learn about available payment methods
- Webhooks - Set up webhooks for payment notifications
- Error Handling - Handle errors gracefully