Socket
Book a DemoInstallSign in
Socket

@weweb/backend-stripe

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@weweb/backend-stripe

Stripe integration for WeWeb backend services

latest
npmnpm
Version
1.1.3
Version published
Weekly downloads
15
50%
Maintainers
4
Weekly downloads
 
Created
Source

WeWeb Stripe Integration

This package provides a Stripe integration for WeWeb backend services, allowing you to easily integrate Stripe's payment processing capabilities into your WeWeb applications.

Features

  • Payment processing with PaymentIntents
  • Customer management
  • Subscription handling
  • Product and pricing management
  • Refund processing

Installation

npm install @weweb/backend-stripe

Configuration

The integration can be configured either through environment variables or by passing options when creating the integration:

import { createStripeIntegration } from '@weweb/backend-stripe';

// Using environment variables
// Set STRIPE_SECRET_KEY in your environment

// OR using options
const stripeIntegration = createStripeIntegration({
  secretKey: 'sk_your_secret_key',
  apiVersion: '2023-10-16' // optional
});

Environment Variables

  • STRIPE_SECRET_KEY: Your Stripe Secret Key (starts with 'sk_')

Usage Examples

Creating a Payment Intent

const paymentIntent = await stripe.methods.create_payment_intent({
  amount: 2000, // Amount in cents
  currency: 'usd',
  payment_method_types: ['card']
});

Creating a Customer

const customer = await stripe.methods.create_customer({
  email: 'customer@example.com',
  name: 'John Doe'
});

Creating a Subscription

const subscription = await stripe.methods.create_subscription({
  customer: 'cus_xxx',
  items: [
    { price: 'price_xxx' }
  ]
});

Creating a Product

const product = await stripe.methods.create_product({
  name: 'Premium Plan',
  description: 'Premium subscription plan'
});

Available Methods

  • create_payment_intent: Create a new PaymentIntent
  • get_payment_intent: Retrieve a PaymentIntent
  • create_customer: Create a new customer
  • get_customer: Retrieve a customer
  • update_customer: Update a customer
  • create_subscription: Create a new subscription
  • get_subscription: Retrieve a subscription
  • update_subscription: Update a subscription
  • create_product: Create a new product
  • create_price: Create a new price
  • create_refund: Create a refund
  • list_customers: List customers
  • list_subscriptions: List subscriptions
  • list_products: List products
  • list_prices: List prices

Security

Never expose your Stripe secret key in client-side code. Always keep it secure and use it only in your backend services.

License

MIT

Keywords

weweb

FAQs

Package last updated on 09 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts