Skip to content

Commit e5848f7

Browse files
committed
cover listUserSubscriptions in docs
1 parent 9d0c82c commit e5848f7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Add subscriptions and billing to your Convex app with [Polar](https://polar.sh).
66

77
```tsx
88
// Get subscription details for the current user
9+
// Note: getCurrentSubscription is for apps that only allow one active
10+
// subscription per user. If you need to support multiple active
11+
// subscriptions, use listUserSubscriptions instead.
912
const {
1013
productKey,
1114
status,
@@ -440,6 +443,15 @@ Get the current user's subscription details:
440443
const subscription = await polar.getCurrentSubscription(ctx, { userId });
441444
```
442445

446+
#### listUserSubscriptions
447+
448+
For apps that support multiple active subscriptions per user,
449+
get all subscriptions for a user:
450+
451+
```ts
452+
const subscriptions = await polar.listUserSubscriptions(ctx, { userId });
453+
```
454+
443455
#### getProducts
444456

445457
List all available products and their prices:

0 commit comments

Comments
 (0)