Trio Checkout SDK Example
This project demonstrates how to integrate the Trio Checkout SDK using:- A local Node.js backend (
server.js) - A local frontend (
index.html) - Python HTTP Server for frontend hosting
Requirements
Before starting, make sure you have installed:- Node.js (v18+ recommended)
- npm
- Python 3
Project Structure
1. Install Backend Dependencies
Create apackage.json file:
2. Configure Credentials
Insideserver.js, replace the following values:
3. Run the Backend Server
Start the server using:4. Run the Frontend Locally
The frontend uses the browser SDK and must be served through an HTTP server. Open a new terminal in the project folder and run:python3 does not work, try:
5. Open the Application
Open your browser and access:How It Works
-
The frontend collects:
- Transaction type
- CPF
- Amount
- The frontend sends a request to:
- The backend creates a Trio Checkout Session using the Trio API.
-
The backend returns the
session_id. - The frontend initializes the Trio SDK:
- The checkout modal opens automatically.
Available Transaction Types
Sandbox Environment
This example uses the Trio Sandbox API:Important Notes
- Make sure port
3000is available for the backend. - Make sure port
8080is available for the frontend. - CORS is enabled in the backend for local development.
- Never expose production credentials publicly.
Example Request Payload
Troubleshooting
Port already in use
Change the port inserver.js:
Python command not found
Install Python 3 or use:CORS errors
Ensure the backend server is running before opening the frontend.Support
For integration support, contact:Download Example Project
You can download the complete local example project here: Download the ZIP file The ZIP package includes:server.jsindex.html- Local backend example
- Frontend checkout example
- SDK integration example

