save sdk name and version

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-08-07 22:21:22 +02:00
committed by Carl-Gerhard Lindesvärd
parent 41e46570b7
commit ccfddc215f
12 changed files with 96 additions and 57 deletions

View File

@@ -7,6 +7,8 @@ import { eventsQueue } from '@openpanel/queue';
import { getRedisCache } from '@openpanel/redis';
import type { PostEventPayload } from '@openpanel/sdk';
import { getStringHeaders } from './track.controller';
export async function postEvent(
request: FastifyRequest<{
Body: PostEventPayload;
@@ -49,9 +51,7 @@ export async function postEvent(
type: 'incomingEvent',
payload: {
projectId: request.projectId,
headers: {
ua,
},
headers: getStringHeaders(request.headers),
event: {
...request.body,
// Dont rely on the client for the timestamp