clearSubscriptionCache
SolvaPay SDK / next/src / clearSubscriptionCache
Function: clearSubscriptionCache()
clearSubscriptionCache(
userId):void
Defined in: packages/next/src/cache.ts:258
Clear subscription cache for a specific user.
Useful when you know subscription status has changed (e.g., after a successful
checkout, subscription update, or cancellation). This forces the next
checkSubscription() call to fetch fresh data from the backend.
Parameters
userId
string
User ID to clear cache for
Returns
void
Example
import { clearSubscriptionCache } from '@solvapay/next';
// After successful payment
await processPayment(request, body);
clearSubscriptionCache(userId); // Force refresh on next check
See
- checkSubscription for subscription checking
- clearAllSubscriptionCache to clear all cache entries
Since
1.0.0