Express.js backend server for Cybrid payment integration.
- RESTful API for Cybrid payment operations
- TypeScript for type safety
- OAuth2 authentication with Cybrid API
- Customer and account management
- Transaction processing
- Secure environment configuration
- Node.js >= 18.0.0
- npm or yarn
- Cybrid API credentials
npm install-
Copy the example environment file:
cp .env.example .env
-
Configure your environment variables in
.env:PORT=5000 NODE_ENV=development CYBRID_CLIENT_ID=your_client_id CYBRID_CLIENT_SECRET=your_client_secret CYBRID_BANK_GUID=your_bank_guid CYBRID_OAUTH_TOKEN_URL=https://auth.sandbox.cybrid.app/oauth/token CYBRID_API_BASE_URL=https://api.sandbox.cybrid.app CYBRID_SCOPE=openid ALLOWED_ORIGINS=http://localhost:5173
npm run devStarts the development server with hot reload using ts-node-dev.
npm run buildCompiles TypeScript to JavaScript in the dist folder.
npm startRuns the compiled JavaScript from the dist folder.
npm run lintRuns ESLint on TypeScript files.
backend/
├── src/
│ ├── config/ # Configuration files
│ ├── cybrid/ # Cybrid SDK integration
│ ├── db/ # Database/storage layer
│ ├── routes/ # API routes
│ └── index.ts # Application entry point
├── .env.example # Example environment variables
├── package.json # Dependencies and scripts
└── tsconfig.json # TypeScript configuration
The backend exposes various endpoints for:
- Customer management
- Account operations
- Payment processing
- Transaction history
See the route definitions in src/routes/ for detailed API documentation.
@cybrid/cybrid-api-bank-typescript- Cybrid Bank API SDK@cybrid/cybrid-api-id-typescript- Cybrid Identity API SDKexpress- Web frameworkaxios- HTTP clientdotenv- Environment variable managementhelmet- Security middlewarecors- Cross-origin resource sharingmorgan- HTTP request logger
typescript- TypeScript compilerts-node-dev- TypeScript execution with hot reload@types/*- Type definitions
- Environment variables for sensitive credentials
- Helmet middleware for secure HTTP headers
- CORS configuration for allowed origins
- OAuth2 token management
The application uses express-async-errors for automatic async error handling in routes.
ISC