Skip to content

Conversation

toddhgardner
Copy link
Member

This change exposes the other environment info on payload to be specified. Everything is just on initialize(options) for simplicity. For example:

  TrackJS.initialize({
    token: 'test token',
    transport,
    dependencies: {
      "foo": "1.2.3"
    },
    originalUrl: "original-url",
    referrerUrl: "referrer-url",
    userAgent: userAgent("Node", "12.1", "windows", "x64", "11.2"),
  });

Rather than exposing every part of the userAgent as options, I built and exported a utility to construct the string. That way, if we are operating in a browser-like environment, you can still just set the userAgent string directly.

To do later: Need to figure out how to expose the agent version as a variable. Need to add some sort of build-step that is more than just typescript compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant