mirror of
https://github.com/LukeHagar/polar.git
synced 2025-12-06 04:20:58 +00:00
cover listUserSubscriptions in docs
This commit is contained in:
12
README.md
12
README.md
@@ -6,6 +6,9 @@ Add subscriptions and billing to your Convex app with [Polar](https://polar.sh).
|
||||
|
||||
```tsx
|
||||
// Get subscription details for the current user
|
||||
// Note: getCurrentSubscription is for apps that only allow one active
|
||||
// subscription per user. If you need to support multiple active
|
||||
// subscriptions, use listUserSubscriptions instead.
|
||||
const {
|
||||
productKey,
|
||||
status,
|
||||
@@ -440,6 +443,15 @@ Get the current user's subscription details:
|
||||
const subscription = await polar.getCurrentSubscription(ctx, { userId });
|
||||
```
|
||||
|
||||
#### listUserSubscriptions
|
||||
|
||||
For apps that support multiple active subscriptions per user,
|
||||
get all subscriptions for a user:
|
||||
|
||||
```ts
|
||||
const subscriptions = await polar.listUserSubscriptions(ctx, { userId });
|
||||
```
|
||||
|
||||
#### getProducts
|
||||
|
||||
List all available products and their prices:
|
||||
|
||||
Reference in New Issue
Block a user