MCPcopy Create free account
hub / github.com/code-with-antonio/nightcode / ingestAiUsage

Function ingestAiUsage

packages/server/src/lib/polar.ts:114–133  ·  view source on GitHub ↗
({ 
  externalCustomerId, 
  eventId, 
  credits
}: IngestAiUsageParams)

Source from the content-addressed store, hash-verified

112};
113
114export async function ingestAiUsage({
115 externalCustomerId,
116 eventId,
117 credits
118}: IngestAiUsageParams) {
119 if (credits <= 0) {
120 return;
121 }
122
123 await polar.events.ingest({
124 events: [
125 {
126 name: "nightcode_usage",
127 externalId: eventId,
128 externalCustomerId,
129 metadata: { credits },
130 },
131 ],
132 });
133};

Callers 1

onFinishFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected