User Subscription Status
To get the subscription status of a user, you can use the getUserSubscription
method.
const subscriptionPlan = await getUserSubscription(user.id);
This method will return the subscription plan of the user if with following properties:
stripeSubscriptionId: string;
stripeCustomerId: string;
stripePriceId: string;
stripeCurrentPeriodEnd;
Also the isPro
property will be set to true
if the user has an active subscription.
isPro: boolean;