File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff 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.
912const {
1013 productKey,
1114 status,
@@ -440,6 +443,15 @@ Get the current user's subscription details:
440443const 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
445457List all available products and their prices:
You can’t perform that action at this time.
0 commit comments