@plutos.one/cou-sdk
v0.2.0
Published
COU SDK for bill fetch, payment, transaction status, and complaint handling
Downloads
24
Keywords
Readme
COU-SDK
Overview
This SDK is structured as a modular TypeScript package for interacting with COU APIs. It separates concerns into:
- Client orchestration
- Transport layer
- Feature modules
- Interfaces and models
- Error handling
Getting started
Installation
npm install @plutosone/cou-sdkUsage
import { CouClient } from '@plutosone/cou-sdk';
const client = new CouClient({
baseUrl: '...',
});
Generate Auth Token
const token = await client.auth.generateToken({
authBaseUrl: process.env.COU_AUTH_URL!,
clientKey: process.env.CLIENT_KEY!,
clientSecret: process.env.CLIENT_SECRET!,
scopes: process.env.SCOPES!,
});Set Token
client.setToken(token.access_token);Make API Call
const response = await client.bills.fetch(
'int',
payload,
);
Data Flow
- Consumer imports the SDK from
src/index.ts. - Consumer creates a new client instance and passes config.
- The client initializes the HTTP transport.
- Client method calls delegate to a feature module.
- Module builds a request and calls the HTTP transport.
- Transport sends the request and parses the response.
- Successful responses return typed models;
License
Copyright © Plutos One. All Rights Reserved.
