-
Notifications
You must be signed in to change notification settings - Fork 351
Closed
Labels
Description
Expected behaviour
The setUser method in the Datadog Tracer library should accept user attributes of various types including number, boolean, and Date, as evident from actual usage and logs.
While this exact payload it's completely valid if bypassed by @ts-ignore, type casting or any other method.
Actual behaviour
The TypeScript definition for the User interface restricts attributes to be of type string. This is inconsistent with actual behavior and leads to unnecessary type errors during development.
Steps to reproduce
Try using the setUser method with user attributes that are not of type string.
tracer.setUser({
id: 1, // number
email: "test@email.com", // string
createdAt: new Date(), // Date object
isEnabled: true, // boolean
});
// TypeScript will throw a type error.
