SDKs

Official mCards SDKs for TypeScript/JavaScript and Python. Both SDKs provide identical functionality with idiomatic APIs for each language.

Full-featured SDK with strict TypeScript types, HMAC-SHA256 signing, Bearer token auth, and 14 resource modules.

Install

npm install @mcards/sdk

Quick Start

typescript
import { McardsSdk } from '@mcards/sdk';

const client = new McardsSdk({
  apiKey: process.env.MCARDS_API_KEY,
  apiSecret: process.env.MCARDS_API_SECRET,
});

const { data } = await client.partner.getProfile();
console.log(data.name);

Features

  • Full TypeScript type definitions
  • Automatic HMAC-SHA256 request signing
  • Bearer token management
  • All 14 API resource modules
  • Pagination helpers
  • Error handling with typed responses
Pythonv2.0.0

Pythonic SDK with httpx, type hints, context manager support, and 14 resource modules.

Install

pip install mcards-sdk

Quick Start

python
from mcards_sdk import McardsSdk

with McardsSdk(
    api_key=os.environ["MCARDS_API_KEY"],
    api_secret=os.environ["MCARDS_API_SECRET"],
) as client:
    profile = client.partner.get_profile()
    print(profile.data["name"])

Features

  • Type hints throughout
  • httpx async-ready HTTP client
  • Context manager support (with statement)
  • Automatic HMAC-SHA256 signing
  • Bearer token management
  • All 14 API resource modules

Cross-Language Compatibility

Both SDKs produce identical HMAC signatures and use the same API endpoints. You can use TypeScript for your frontend/Node.js services and Python for data pipelines or backend services, and they will work together seamlessly.

Signature verification
# Both SDKs produce identical output:
Input:  body = '""', secret = "test-secret"
Output: HMAC_SHA256 test-key;qmj5Sg2IxB2/qySyYvXSE7oWb0LCM9X/HrKzhI49YFA=