const { result, error } = await unprice.customers.getUsage("cus_1234567890");
if (error) {
// handle potential network or bad request error
// a link to our docs will be in the `error.docs` field
console.error(error.message);
return;
}
console.log(result);
{
"usage": [
{
"featureSlug": "feature_1",
"used": 100,
"limit": 1000,
"resetAt": 1681492000
}
]
}
Request
The ID of the customer to get usage for
Response
Array of usage information for each feature
The amount of usage consumed
The usage limit for the feature
The timestamp when the usage will reset