import { init } from "metrifox-js";
const metrifoxClient = init({
apiKey: process.env.METRIFOX_API_KEY
});
// Check if customer has an active subscription
const hasActiveSubscription = await metrifoxClient.customers.checkActiveSubscription("test-customer-key");
console.log(hasActiveSubscription); // true or false
if (hasActiveSubscription) {
console.log("Customer has an active subscription");
} else {
console.log("Customer does not have an active subscription");
}