DocsClient-Side Usage
Client-Side Usage
Learn how to use PayKit in React applications.
PayKit provides React hooks for seamless client-side integration. The React SDK is a client for the PayKit API that handles the [data, error]
pattern automatically and provides loading states.
Basic Setup
Initialize PayKit
Wrap your app with the PayKit provider:
Customer
Creating a Customer
Retrieving a Customer
Updating a Customer
Checkout
Creating a Checkout
Retrieving a Checkout
Subscription
Creating a Subscription
Retrieving a Subscription
Updating a Subscription
Canceling a Subscription
Hook Methods
All PayKit hooks provide consistent methods with .run
and .loading
to perform the action and give a loading state
create
- Function to create a resourceretrieve
- Function to retrieve resourceupdate
- Function to update resourcecancel
- Function to cancel resource (subscription only)