Skip to main content

TypeScript SDK

For the complete TypeScript SDK documentation, please visit our GitHub repository:

๐Ÿ“ฆ @streamsdk/typescript on GitHub โ†’

Overviewโ€‹

The Stream TypeScript SDK provides a complete Node.js/TypeScript interface for:

  • ๐Ÿ” Secure API Key authentication
  • ๐Ÿ‘ฅ Customer (Consumer) management
  • ๐Ÿ“ฆ Product catalog management
  • ๐Ÿ’ณ Payment link creation
  • ๐Ÿ”„ Subscription handling
  • ๐Ÿงพ Invoice generation
  • ๐ŸŽŸ๏ธ Coupon & discount management

Installationโ€‹

npm install @streamsdk/typescript

Quick Exampleโ€‹

import StreamSDK from "@streamsdk/typescript";

const client = StreamSDK.init(process.env.STREAM_API_KEY!);

const result = await client.createSimplePaymentLink({
name: "Monthly Subscription",
amount: 99.99,
consumer: {
email: "customer@example.com",
name: "Ahmad Ali",
phone: "+966501234567",
},
product: {
name: "Premium Plan",
price: 99.99,
},
successRedirectUrl: "https://yourapp.com/success",
failureRedirectUrl: "https://yourapp.com/failure",
});

console.log("Payment URL:", result.paymentUrl);

For complete documentation, examples, and API reference, visit the GitHub repository.