Billing.js
  • Introduction
  • Features
  • Getting started
    • Installation
    • Add to your app
      • Wrap your app
      • Setup Pricing page
      • Setup Customer Portal
    • Configure Webhooks and Triggers
      • Subscription webhook
      • Customer Webhook
      • New user trigger
  • Guides
    • Single Sign-On
    • Shared subscriptions
    • Local currency support
    • Automatic Dispute Response
  • Components
    • <BillingProvider />
    • Pricing Page
      • <PaymentField />
      • <PaymentSummary />
      • <PromotionCode />
      • <PaymentModal />
    • Customer Portal
      • <CustomerProfile />
      • <Subcriptions />
      • <ManageSharedSubscriptionModal />
      • <PaymentMethods />
      • <Invoices />
  • Hooks
    • useAuth
    • useProducts
  • Methods
    • Product
      • getProducts
    • Customer
      • getCustomerSubscriptions
      • getCustomerPaymentMethods
      • getCustomerInvoices
    • Subscription
      • addSubscription
      • cancelSubscription
      • updateSubscription
    • Payment Method
      • attachPaymentMethodToCustomer
      • detachPaymentMethodFromCustomer
      • setPaymentMethodAsDefault
    • Shared Subscription
      • getSharedSubscription
      • getSharedSubscriptionUsers
      • updateSharedSubscriptionUsers
Powered by GitBook
On this page
  • The subscription webhook
  • The customer webhook
  • The new user trigger

Was this helpful?

  1. Getting started

Configure Webhooks and Triggers

PreviousSetup Customer PortalNextSubscription webhook

Last updated 2 years ago

Was this helpful?

The best way to check if your users are having an active subscription and activate the premium features accordingly is to keep a copy of their current subscription state on your database.

To do that you will need to configure webhooks that will be called when a subscription is created or updated on Stripe.

Those are required to support shared subscriptions and subscription transfers

The subscription webhook

To store the updated state of your customer's subscriptions

The customer webhook

To store the updated state of your customer's shared subscriptions and to support transferring subscription from one user to another

The new user trigger

To handle new user already having a subscription, either because they were added to a shared subscription or because you added their subscription manually from the Stripe Dashboard

Subscription webhook
Customer Webhook
New user trigger