Get Started
Installation
Install the Fawran SDK
Installation
Install the Fawran SDK in your Node.js project. This guide covers SDK setup; provider configuration happens in the dashboard.
Package Manager
npm i @copto/fawranConfiguration
Initialize the SDK with your API key:
import { Fawran } from "@copto/fawran";
const fawran = new Fawran({
secretKey: process.env.FAWRAN_SECRET_KEY,
// Optional: override the API URL (for self-hosted)
// apiUrl: "https://api.fawran.copto.org"
});in .env
FAWRAN_SECRET_KEY=fawran_sk_your_api_key_hereTypeScript
The SDK is written in TypeScript and includes full type definitions. No additional @types/* packages are needed.
import {
Fawran,
AttachResult,
CheckResult,
TrackResult,
} from "@copto/fawran";
const fawran = new Fawran({ secretKey: "..." });
// All methods are fully typed
const result: AttachResult = await fawran.attach({
customer: "user_123",
product: "pro",
});