Skip to content

toneflix/maplerad-sdk

Repository files navigation

Maplerad SDK

NPM Downloads npm version License codecov CI Deploy Docs

Type-safe Node.js SDK for the maplerad API.

This package provides both a class-based client and a runtime-first client for working with maplerad customers, wallets, transfers, virtual accounts, bills, FX, crypto, issuing, and supporting lookup endpoints.

Documentation

Installation

The package is published as maplerad-sdk.

pnpm add maplerad-sdk

Quick Start

Runtime-First Client

import { createClient } from 'maplerad-sdk';

const sdk = createClient({
  environment: 'sandbox',
  clientSecret: process.env.MAPLERAD_CLIENT_SECRET!,
});

const wallets = await sdk.api.wallets.list();

Class-Based Client

import { Core } from 'maplerad-sdk';

const sdk = new Core({
  environment: 'sandbox',
  clientSecret: process.env.MAPLERAD_CLIENT_SECRET!,
});

const customer = await sdk.api.customers.get({ id: 'cus_123' });

Minimal Configuration

You can keep SDK defaults in maplerad.config.js using defineConfig from @oapiex/sdk-kit:

import { defineConfig } from '@oapiex/sdk-kit';

export default defineConfig({
  clientSecret: process.env.MAPLERAD_CLIENT_SECRET,
  environment: 'sandbox',
  debugLevel: 3,
});

With defaults in place, this works too:

import { createClient } from 'maplerad-sdk';

const sdk = createClient({});

Example Customer Flow

import { createClient, type CustomerInput } from 'maplerad-sdk';

const sdk = createClient({
  environment: 'sandbox',
  clientSecret: process.env.MAPLERAD_CLIENT_SECRET!,
});

const payload: CustomerInput = {
  first_name: 'Ada',
  last_name: 'Lovelace',
  email: '[email protected]',
  country: 'NG',
};

const createdCustomer = await sdk.api.customers.create(payload);
const customers = await sdk.api.customers.list({});
const customer = await sdk.api.customers.get({ id: createdCustomer.id! });

Main Exports

  • createClient() for runtime-first usage
  • Core for class-based usage
  • ApiBinder and BaseApi for SDK extension points
  • Generated schema types exported from Schema
  • defineConfig, createSdk, Http, Builder, and related runtime helpers re-exported from @oapiex/sdk-kit

Built On

This SDK is built on top of @oapiex/sdk-kit, which provides the shared runtime primitives behind configuration, auth handling, transport, and manifest binding.

Available API Groups

  • Customers and identity
  • Wallets and transfers
  • Virtual accounts and collections
  • Bills and utilities
  • FX, crypto, and USD
  • Issuing and cards

See the full grouped reference in the docs site:

Development

pnpm install
pnpm lint
pnpm test
pnpm coverage
pnpm build
pnpm docs:dev
pnpm docs:build

Environment Variables

MAPLERAD_CLIENT_SECRET=your_client_secret_key
MAPLERAD_CLIENT_ID=your_client_id
MAPLERAD_ENCRYPTION_KEY=your_encryption_key

Keep secrets on the server side. Do not expose Maplerad credentials in client-side applications.

About

NodeJs SDK for Maplerad API

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors