Skip to content

Commit 7a85478

Browse files
committed
add 'event trigger' event
1 parent c5840ce commit 7a85478

File tree

1 file changed

+15
-0
lines changed
  • apps/nextjs/src/pages/api/v1

1 file changed

+15
-0
lines changed

apps/nextjs/src/pages/api/v1/log.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { NextApiRequest, NextApiResponse } from "next";
22
import { z } from "zod";
33

4+
import { posthog } from "@acme/api/posthog";
45
import { prisma } from "@acme/db";
56

67
import admin from "~/utils/firebaseAdmin";
@@ -139,5 +140,19 @@ export default async function handler(
139140
}
140141
}
141142

143+
posthog?.capture({
144+
distinctId: userId,
145+
event: "trigger event",
146+
properties: {
147+
notify,
148+
event,
149+
description,
150+
icon,
151+
projectId: projectDoc[0].id,
152+
channelId: channelDoc[0].id,
153+
},
154+
});
155+
void posthog?.shutdownAsync();
156+
142157
res.send(notification);
143158
}

0 commit comments

Comments
 (0)