node-strava/node-strava-v3

wish: set default User-Agent

markstos opened this issue · 1 comments

Setting a default user agent string is something that Strava's own REST client in Go does:

https://github.com/strava/go.strava/blob/f5c7cee1038b80d25e3d262208d295c10ca2ac4b/service.go#L116

I'm thinking it might be 'node-strava-v3 '+version.

We can automatically introspect the package version from package.json just by calling require on package.json and reading the version property:

 var version = require('../package').version;

The primary place seeing this in their logs would be the Strava service itself. If there was a problem with how this library was accessing the Strava servers, having a consistent user agent string across requests would help Strava recognize that the common issue had to with a particular version of this library.

This is resolved in #55, which will be merged.