1.0.4 • Published 4 months ago

iaptic-js v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Iaptic JS

License: MIT

A modern TypeScript/JavaScript library for seamless integration with Iaptic's payment and subscription services, powered by Stripe. Handle one-time purchases, subscriptions, and payment management with developer-friendly APIs.

Installation

NPM (recommended)

npm install --save iaptic-js

CDN

<!-- UMD version (for direct browser use) -->
<script src="https://cdn.jsdelivr.net/npm/iaptic-js@1.0.4/dist/iaptic-js.js"></script>

<!-- ES Module version (for modern browsers) -->
<script type="module">
  import { IapticJS } from 'https://cdn.jsdelivr.net/npm/iaptic-js@1.0.4/dist/iaptic-js.esm.js';
</script>

Features ✨

  • ✅ Stripe integration out-of-the-box
  • ✅ Type-safe TypeScript API
  • ✅ Unified interface for payments & subscriptions
  • ✅ Cross-platform support (Web, React Native, Node.js)
  • ✅ Automatic purchase verification

Quick Start 🚀

import { IapticJS } from 'iaptic-js';

// Initialize with your Stripe credentials
const iaptic = IapticJS.createAdapter({
  type: 'stripe',
  appName: 'my-app',         // Your application identifier
  apiKey: '1234567890',      // Get from Iaptic dashboard
  stripePublicKey: 'pk_test_1234567890'
});

// Fetch available products
const { products, subscriptions } = await iaptic.getCatalog();

// Handle purchase flow
async function purchaseProduct(productId: string) {
  try {
    const result = await iaptic.order({
      offerId: productId,
      applicationUsername: 'user-123',
      successUrl: window.location.href + '/success',
      cancelUrl: window.location.href + '/cancel'
    });
    
    console.log('Purchase completed:', result);
  } catch (error) {
    console.error('Payment failed:', error);
  }
}

Documentation 📚

Explore our comprehensive guides:

License

MIT © Iaptic

1.0.4

4 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago