cover listUserSubscriptions in docs

This commit is contained in:
Shawn Erquhart
2025-04-22 18:27:43 -04:00
parent 9d0c82c66d
commit e5848f7a35

View File

@@ -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: