diff --git a/src/index.ts b/src/index.ts index a01236f..83b0fe9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import UAParser from 'ua-parser-js' // Get the user ID stored in the client, if it does not exist, make a random one, save it in the client, and return it. const getUserId = (event: MCEvent) => { const { client } = event - let userId = client.get('user_id') + let userId = event.payload.user_id || client.get('user_id') if (!userId) { userId = crypto.randomUUID() client.set('user_id', userId, { scope: 'infinite' })