mirror of
https://github.com/LukeHagar/polar.git
synced 2025-12-09 20:57:43 +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
|
```tsx
|
||||||
// Get subscription details for the current user
|
// 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 {
|
const {
|
||||||
productKey,
|
productKey,
|
||||||
status,
|
status,
|
||||||
@@ -440,6 +443,15 @@ Get the current user's subscription details:
|
|||||||
const subscription = await polar.getCurrentSubscription(ctx, { userId });
|
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
|
#### getProducts
|
||||||
|
|
||||||
List all available products and their prices:
|
List all available products and their prices:
|
||||||
|
|||||||
Reference in New Issue
Block a user