SDK Libraries Overview
Staqr provides auto-generated SDK libraries that give you type-safe, language-native interfaces to our APIs.
Why Use SDKs?
| Feature | Raw API | Postman | SDK |
|---|---|---|---|
| Type safety | No | No | Yes |
| IDE autocomplete | No | No | Yes |
| Compile-time checks | No | No | Yes |
| Pre-built models | No | No | Yes |
| Code generation | No | No | Yes |
| Visual testing | No | Yes | No |
| Language agnostic | Yes | Yes | No |
Use SDKs when:
- Building production integrations
- Type safety is important
- You want IDE support and autocomplete
- Working in supported languages
Use Postman when:
- Exploring APIs interactively
- Testing without code
- Training or demos
Use Raw API when:
- Language not supported by SDK
- Need maximum flexibility
- Simple one-off requests
Available SDKs
Currently Available
| Language | Package | APIs | Status |
|---|---|---|---|
| TypeScript/JavaScript | @staqr/commerce-api-v0 | Commerce v0 | Stable |
| TypeScript/JavaScript | @staqr/commerce-api-v1 | Commerce v1 | Stable |
| TypeScript/JavaScript | @staqr/commerce-api-v2 | Commerce v2 | Stable |
| TypeScript/JavaScript | @staqr/staqr-api | Staqr Platform | Stable |
| Python | staqr_commerce_v0 | Commerce v0 | Stable |
| Python | staqr_commerce_v1 | Commerce v1 | Stable |
| Python | staqr | Staqr Platform | Stable |
Coming Soon
| Language | Status | Target |
|---|---|---|
| PHP | Planned | Q2 2026 |
| Java | Planned | Q2 2026 |
| C# (.NET) | Planned | Q2 2026 |
| Go | Planned | Q3 2026 |
| Dart (Flutter) | Planned | Q3 2026 |
| Swift (iOS) | Planned | Q3 2026 |
| Kotlin (Android) | Planned | Q3 2026 |
Quick Start
TypeScript
# Install (local path for now - not yet published to npm)
npm install file:./sdks/commerce-v1-typescript
import { Configuration, CustomerManagementApi } from '@staqr/commerce-api-v1';
const config = new Configuration({
basePath: 'https://commerce.staqr.com/api',
accessToken: process.env.COMMERCE_API_TOKEN
});
const api = new CustomerManagementApi(config);
const customers = await api.listCustomers();
See TypeScript Guide for full documentation.
Python
# Install (local path for now - not yet published to PyPI)
pip install ./sdks/commerce-v1-python
import staqr_commerce_v1
from staqr_commerce_v1 import Configuration, ApiClient, CustomerManagementApi
config = Configuration()
config.host = "https://commerce.staqr.com/api"
config.access_token = os.environ.get("COMMERCE_API_TOKEN")
with ApiClient(config) as client:
api = CustomerManagementApi(client)
customers = api.list_customers()
See Python Guide for full documentation.
SDK Architecture
All SDKs are auto-generated from OpenAPI specifications using OpenAPI Generator.
OpenAPI Spec (YAML/JSON)
↓
OpenAPI Generator
↓
┌───────────────────────┐
│ TypeScript SDK │
│ Python SDK │
│ (Future: Java, Go...) │
└───────────────────────┘
Benefits of generation:
- SDKs always match API specification
- Consistent patterns across languages
- Automatic updates when API changes
- Type definitions from API schema
API Coverage
Commerce API v1 (Recommended)
The primary business API for customer and subscription management.
Available operations:
- Customer Management - CRUD operations, search, hierarchy
- Subscription Management - Create, modify, terminate
- Billing - Invoices, payments, wallets, credit operations
- Orders - Quote to order, fulfillment
- Product Catalog - Offers, services, charges
Commerce API v2 (Generic CRUD)
Simplified REST interface for basic entity operations.
Use for:
- Simple CRUD on any entity
- Generic operations when v1 doesn't have specific endpoint
Commerce API v0 (Legacy)
Complete legacy API - use v1 for new integrations.
Contains:
- 800+ endpoints (comprehensive but complex)
- Legacy naming conventions
- Migration path documented
Staqr Platform API
Core platform operations for flows, connections, and integrations.
Available operations:
- Flows - Create, execute, manage automation flows
- Connections - Credential management for integrations
- Folders - Organize resources
- Users - User and permission management
Security Considerations
Never embed API keys in client-side code or mobile applications. Always use server-side proxies.
Secure patterns:
- Store credentials in environment variables
- Use server-to-server calls for sensitive operations
- Implement backend proxy for mobile apps
- Rotate keys regularly
See Authentication Guide for detailed security practices.
Support
SDK Issues:
- Check SDK-specific guides for common issues
- Report bugs: https://github.com/staqr/staqr/issues
Feature Requests:
- Request new languages or features via GitHub issues
- Community contributions welcome
Next Steps
- TypeScript Guide - Full TypeScript/JavaScript documentation
- Python Guide - Full Python documentation
- Authentication - API key and OAuth setup
- Mobile Considerations - Security for mobile apps