Skip to main content

fype SDKs

fype provides official SDKs for Node.js and Python to make integration seamless.

Node.js SDK

Installation

Initialization

Usage

1. One-Time Payments & Webhooks

2. Subscription Mandates

3. Plan Configuration

4. Entitlements (Feature Gates)

5. Metered Billing Usage Reporting


Python SDK

Installation

Initialization

Usage

1. One-Time Payments & Webhooks

2. Subscription Mandates

3. Plan Configuration

4. Entitlements (Feature Gates)

5. Metered Billing Usage Reporting

Best Practices

  • Timeout Management: Our SDKs have built-in timeout handling. We recommend a 15-second timeout for payment and subscription operations.
  • Error Handling: Always wrap your SDK calls in try/catch (Node.js) or try/except (Python) blocks to handle error classes:
  • AuthenticationError: Raised when base API Key authentication fails.
  • InvalidRequestError: Raised for bad request parameters or resource not found.
  • ApiConnectionError: Raised for network timeout/connectivity issues.
  • FypeError: Base server error mapping.
  • Async/Await: Both SDKs are built to be non-blocking. Use async/await patterns for the best performance.
  • Signature Verification: Note that the Node.js verifySignature method returns true on success but throws a FypeSignatureVerificationError on mismatch. The Python version returns True or raises SignatureVerificationError.