amplitude/Amplitude-Node

Passing device Id upon initialization

Offen

#36 geöffnet am 28.09.2020

 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (20 Forks)auto 404
enhancementgood first issue

Repository-Metriken

Stars
 (73 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Summary

Hey,

We are currently using the node SDK for amplitude in one of our backends. It seems that in order to log an event to amplitude, the device id or user id is required as specified here: https://developers.amplitude.com/docs/http-api-v2#properties-1

Currently our backend does not track our users. We wanted to pass a variable for the device_id such as : service_server which would just be the name of our backend.

const amplitude = init(AMPLITUDE_TOKEN, { device_id: AMPLITUDE_DEVICE_ID });

Motivations

This would allow us to avoid passing the deviceId every time we want to log an event, which is not ideal since it is always the same anyways.

Don't hesitate to let me know if there is a better way of doing this. I'm new to using amplitude :)

Contributor Guide