Documentation
    • Back to home
    • StripeKit
    • Installation
    • Getting Started
    • Choosing a Mode
    • Type Reference
    • Setup
      • Configuration
      • Timezones
      • Storage Adapter
      • Money and Currency
      • Error Handling
    • Stripe
      • Elements
    • Modules
      • Overview
      • Customers
        • Overview
        • List
        • Retrieve
        • Find or Create by Email
        • Create
        • Update
        • Sync
        • Delete
      • Payment Methods
        • Overview
        • Create Setup Intent
        • List
        • Attach
        • Detach
        • Set Default
        • Sync
      • Payments
        • Overview
        • Pay With Saved Method
        • Create
        • Retrieve
        • Confirm
        • Cancel
        • Sync
      • Checkout
        • Overview
        • Get
        • Create
        • Submit Fields
        • Apply Coupon
        • Mark Complete
      • Subscriptions
        • Overview
        • Create
        • Retrieve
        • Cancel
        • Resume
        • Toggle Collection Method
        • Update Fields
        • Apply Promotion Code
        • List By Customer
        • Find By Metadata
        • Sync
      • Invoices
        • Overview
        • Retrieve
        • List By Customer
        • List By Subscription
        • Pay With Saved Method
        • Void
        • Finalize
        • Sync
      • Coupons
        • Overview
        • Create
        • Validate
        • Apply To Subscription
        • List
        • Deactivate
      • Webhooks
        • Overview
        • Process
        • Events Reference
      • Sync
        • Overview

    Getting Started

    Why StripeKit#

    StripeKit wraps the official stripe SDK with a simple, opinionated layer for customers, payment methods, payments, checkout, subscriptions, invoices, coupons and webhooks, so you can integrate Stripe into your own application without becoming a Stripe API expert.
    You stay in full control of your database and UI. StripeKit only talks to Stripe: it creates and reads Stripe objects, normalizes the responses into clean, timezone-aware records, and, if you give it a storage adapter, persists that normalized state for you.
    One init() call. Provide your secret key, choose api or elements mode, optionally set a timezone, and every module is ready to use.
    You choose the flow. In api mode, payment and checkout calls return a hosted Stripe URL you redirect the customer to. In elements mode, they return a clientSecret your own frontend uses to confirm the payment with Stripe Elements. In both mode, you decide per call.
    Elements are fully optional. The browser-side helpers live in a separate @ricardoneudorfer/stripekit/elements entry point. If you don't need Stripe Elements, you never import it.
    Timezones handled correctly. Every timestamp StripeKit returns is first normalized to UTC (Stripe's native format), then, if you configured a timezone, converted once more into that timezone for display. Both values are always returned so you never have to do the math yourself.
    You own your data. StripeKit never requires a database. Pass an optional storage adapter to persist customers, subscriptions, invoices, payments and payment methods in your own schema; without one, StripeKit still works, it just won't persist anything for you.
    Covers the whole billing surface. Customers, payment methods, one-off payments, checkout (payment or subscription, with custom fields and coupons), subscriptions, invoices, coupons and promotion codes, and webhooks with automatic state sync.

    Quick start#

    Every action StripeKit can perform is available under kit.<module>.<action>(). Initialize StripeKit once and share the instance across your app, for example via a DI container or a singleton factory.

    Where to go next#

    Configuration for the full list of init() options.
    Choosing a mode to understand api, elements and both.
    Modules overview for the full list of available modules and calls.
    Timezones for how timestamps are normalized and localized.
    Storage adapter to persist Stripe state in your own database.
    Previous
    Installation
    Next
    Choosing a Mode
    Built with