Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function log(label: string, properties?: object) {
const args = { label, properties };
if (isInDev()) {
console.log(args);
} else {
Segment.trackWithProperties("log", args);
}
}
export function subscriptionUnverified(reason: "expired" | "never-bought") {
Segment.trackWithProperties("subscription_unverified", {
reason,
});
}
export function userFinishedCheckup(mood: "good" | "neutral" | "bad") {
Segment.trackWithProperties("user_finished_checkup", {
mood,
});
}
export function subscriptionFoundInCache(value: string) {
Segment.trackWithProperties("subscription_found_in_cache", {
value,
});
}
export function subscriptionVerified(
method: "cache" | "online" | "grandfathered"
) {
Segment.trackWithProperties("subscription_verified", {
method,
});
}
export function userSubscribed(expirationUnixTimestamp: number) {
Segment.trackWithProperties("user_subscribed", {
expirationDate: dayjs.unix(expirationUnixTimestamp).format(),
});
}
export function userRequestedPincodeReset(code: string) {
Segment.trackWithProperties("user_requested_code", {
code,
});
}
export function userEncounteredPaymentError(err: string) {
Segment.trackWithProperties("user_encountered_payment_error", {
error: err,
});
}