need to utilize the new createUsageEvent method on useBilling from v0.16.2
effects all examples in home-client.txt (nextjs) and index.tsx (tanstack) in the
can do away with dedicated usage events api route in favor of the catchall since it's handled in the sdk
this needs replacing:
const response = await fetch("/api/usage-events", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
usageMeterSlug: "fast_generations",
amount,
transactionId,
}),
});
with something like:
const result = await billing.createUsageEvent({
usageMeterSlug: "fast_generations",
amount,
transactionId,
});
need to utilize the new
createUsageEventmethod onuseBillingfrom v0.16.2effects all examples in
home-client.txt(nextjs) andindex.tsx(tanstack) in thecan do away with dedicated usage events api route in favor of the catchall since it's handled in the sdk
this needs replacing:
with something like: