Skip to content

Commit 928113b

Browse files
authored
chore: Support Engine Core and Webhook usage events (#6960)
1 parent c8b8b2f commit 928113b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/whole-women-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/service-utils": patch
3+
---
4+
5+
chore: Support Engine Core and Webhook usage events

packages/service-utils/src/core/usageV2.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
export const USAGE_V2_SOURCES = [
22
"bundler",
3-
"engine",
3+
"engine", // Engine Core -- treat as a client-side event
4+
"engine-cloud", // Engine Cloud
45
"insight",
56
"nebula",
67
"rpc",
78
"sdk",
89
"storage",
910
"wallet",
1011
"pay",
12+
"webhook",
1113
] as const;
1214
export type UsageV2Source = (typeof USAGE_V2_SOURCES)[number];
15+
1316
export function getTopicName(source: UsageV2Source) {
1417
switch (source) {
1518
// Some sources are sent from clients and are written to an "untrusted" table.
1619
case "sdk":
1720
case "engine":
1821
return `usage_v2.untrusted_raw_${source}`;
22+
case "engine-cloud":
23+
return "usage_v2.raw_engine";
1924
default:
2025
return `usage_v2.raw_${source}`;
2126
}

0 commit comments

Comments
 (0)