npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rawdash/connector-stripe

v0.29.2

Published

Rawdash connector for Stripe — billing, subscriptions, and payments

Readme

@rawdash/connector-stripe

npm version license

Sync customers, products, prices, subscriptions, and invoices alongside charge, payment, dispute, and refund events from your Stripe account.

Install

npm install @rawdash/connector-stripe

Authentication

Authenticates with a Stripe restricted API key that has read-only access to the resources you want to sync.

  1. Open the Stripe Dashboard → Developers → API keys.
  2. Create a restricted key with Read access for the resources you plan to sync (customers, products, prices, subscriptions, invoices, charges, payment intents, disputes, refunds).
  3. Store the key as a secret and reference it from the connector config as apiKey: secret("STRIPE_API_KEY").

Configuration

| Field | Type | Required | Description | | ----------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------- | | apiKey | secret | Yes | Stripe Restricted API key with read-only access. Create one at Dashboard → Developers → API keys. | | accountId | string | No | Stripe Connect account ID. Only needed if you are a platform accessing a connected account. | | resources | array | No | Which Stripe resources to sync. Omit to sync all resources. The API key only needs Read scope for the resources listed here. |

Resources

  • stripe_customer (entity) - Customers with email, name, default currency, and delinquency state.
    • Endpoint: GET /v1/customers
  • stripe_product (entity) - Products in your catalog, including active state.
    • Endpoint: GET /v1/products
  • stripe_price (entity) - Prices with unit amount, currency, and recurring interval, linked to their product.
    • Endpoint: GET /v1/prices
  • stripe_subscription (entity) - Subscriptions with status, current period, cancellation state, and computed monthly recurring revenue (mrrAmount, in the smallest currency unit).
    • Endpoint: GET /v1/subscriptions
    • mrrAmount is computed as unit_amount x quantity, normalized to a monthly cadence (yearly / 12, weekly x 52 / 12, etc.).
    • customerId: Customer the subscription belongs to.
    • status: Subscription status (active, canceled, ...).
    • planId: Price id of the first subscription item.
    • currentPeriodStart: Current period start (unix seconds).
    • currentPeriodEnd: Current period end (unix seconds).
    • cancelAtPeriodEnd: Whether the subscription cancels at period end.
    • canceledAt: Cancellation time (unix seconds), if canceled.
    • trialEnd: Trial end time (unix seconds), if any.
    • mrrAmount (cents): Monthly recurring revenue in the smallest currency unit.
    • currency: ISO currency code.
    • created: Creation time (unix seconds).
  • stripe_invoice (entity) - Invoices with amount due, amount paid, status, and due date, linked to their customer and subscription.
    • Endpoint: GET /v1/invoices
    • customerId: Customer the invoice belongs to.
    • subscriptionId: Subscription the invoice belongs to, if any.
    • status: Invoice status (draft, open, paid, ...).
    • amountDue (cents): Amount due in the smallest currency unit.
    • amountPaid (cents): Amount paid in the smallest currency unit.
    • currency: ISO currency code.
    • created: Creation time (unix seconds).
    • dueDate: Due date (unix seconds), if any.
    • hostedInvoiceUrl: Hosted invoice URL, if any.
  • stripe_charge (event) - Charge attempts with amount, currency, status, and failure code, timestamped at creation.
    • Endpoint: GET /v1/charges
    • id: Stripe charge id.
    • customerId: Customer charged, if any.
    • amount (cents): Charge amount in the smallest currency unit.
    • currency: ISO currency code.
    • status: Charge status (succeeded, failed, ...).
    • failureCode: Failure code, if the charge failed.
    • paymentIntentId: Associated payment intent id, if any.
  • stripe_payment_intent (event) - Payment intents with amount, currency, and status, timestamped at creation.
    • Endpoint: GET /v1/payment_intents
    • id: Stripe payment intent id.
    • customerId: Customer, if any.
    • amount (cents): Intent amount in the smallest currency unit.
    • currency: ISO currency code.
    • status: Payment intent status.
  • stripe_dispute (event) - Disputes with amount, currency, reason, and status, linked to the disputed charge.
    • Endpoint: GET /v1/disputes
    • id: Stripe dispute id.
    • chargeId: Disputed charge id.
    • amount (cents): Disputed amount in the smallest currency unit.
    • currency: ISO currency code.
    • reason: Dispute reason.
    • status: Dispute status.
  • stripe_refund (event) - Refunds with amount, currency, reason, and status, linked to the refunded charge.
    • Endpoint: GET /v1/refunds
    • id: Stripe refund id.
    • chargeId: Refunded charge id, if any.
    • amount (cents): Refunded amount in the smallest currency unit.
    • currency: ISO currency code.
    • reason: Refund reason, if any.
    • status: Refund status, if any.

Example

import {
  defineConfig,
  defineDashboard,
  defineMetric,
  secret,
} from '@rawdash/core';

const stripe = {
  name: 'stripe',
  connectorId: 'stripe',
  config: {
    apiKey: secret('STRIPE_API_KEY'),
    resources: ['customers', 'subscriptions', 'invoices', 'charges'],
  },
};

export default defineConfig({
  connectors: [stripe],
  dashboards: {
    revenue: defineDashboard({
      widgets: {
        active_subscriptions: {
          kind: 'stat',
          title: 'Active subscriptions',
          metric: defineMetric({
            connector: stripe,
            shape: 'entity',
            entityType: 'stripe_subscription',
            fn: 'count',
            filter: [{ field: 'status', op: 'eq', value: 'active' }],
          }),
        },
      },
    }),
  },
});

Rate limits

Stripe 429 responses carry a Retry-After header; requests are retried with exponential backoff. List pagination uses the starting_after cursor (limit 100).

Limitations

  • Monetary amounts are stored in the smallest currency unit (e.g. cents), matching the Stripe API.
  • The set of synced resources is controlled by the resources config field; omit it to sync all of them.
  • Incremental syncs use a 7-day lookback for entities and created[gt] for events.

Links

License

Apache-2.0