# Express SDK

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

# Express SDK

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

**[📦 @streamsdk/express on GitHub →](https://github.com/streampayments/streamsdk-express)**

## Quick Links

- **[Installation & Quick Start](https://github.com/streampayments/streamsdk-express#installation)**
- **[API Documentation](https://github.com/streampayments/streamsdk-express#api-documentation)**
- **[Code Examples](https://github.com/streampayments/streamsdk-express/tree/main/examples)**
- **[Demo Application](https://github.com/streampayments/stream-express-sdk-demo)**
- **[npm Package](https://www.npmjs.com/package/@streamsdk/express)**

## Overview

The Stream Express SDK provides a clean, declarative way to integrate Stream payments into your Express.js applications. Built on top of [@streamsdk/typescript](https://www.npmjs.com/package/@streamsdk/typescript), it offers drop-in handlers for checkout flows and webhook processing.

**Key Benefits:**

- 🚀 **Simple Integration** - Add payment processing in minutes
- 🔒 **Type-Safe** - Full TypeScript support with type definitions
- 🎯 **Event-Driven** - Clean event handlers for webhook processing
- 🔄 **Flexible** - Supports guest and authenticated checkout flows
- 📦 **Lightweight** - Minimal dependencies (~7KB)
- 🔗 **Auto-Updates** - Inherits stream-sdk updates automatically

## Installation

```bash
npm install @streamsdk/express
```

## Quick Example

```typescript

const app = express();
app.use(express.json());

// Payment link handler
app.get("/checkout", Checkout({
  apiKey: process.env.STREAM_API_KEY!,
  successUrl: "https://myapp.com/success",
  returnUrl: "https://myapp.com/cancel",
}));

// Webhook handler with events
app.post("/webhooks/stream", Webhooks({
  apiKey: process.env.STREAM_API_KEY!,
  onPaymentSucceeded: async (data) => {
    console.log("Payment succeeded:", data);
    // Update your database, send confirmation emails, etc.
  },
  onPaymentFailed: async (data) => {
    console.log("Payment failed:", data);
  },
  onInvoiceCreated: async (data) => {
    console.log("Invoice created:", data);
  },
}));

app.listen(3000);
```

For complete documentation, examples, and API reference, visit the [GitHub repository](https://github.com/streampayments/streamsdk-express).

## Demo Application

Want to see it in action? Clone and run the **[Express SDK demo repository](https://github.com/streampayments/stream-express-sdk-demo)** locally for a quick working example.

## Related SDKs

- **[TypeScript SDK](/sdks/typescript)** - Core SDK for Node.js/TypeScript
- **[API Reference](/api)** - REST API documentation
- **[Webhooks Guide](/webhooks)** - Webhook event reference
