dopecodez / Wikipedia

Wikipedia for node and the browser
MIT License
82 stars 19 forks source link

Allow to customize the user agent #48

Closed mbork closed 1 year ago

mbork commented 1 year ago

See https://meta.wikimedia.org/wiki/User-Agent_policy. Set the environment variable WIKIPEDIA_USER_AGENT to override the default.

dopecodez commented 1 year ago

This is an interesting proposal. While I do agree that customizing the user agent is a good feature to support, I do not think a node package should be using any environment variables directly - especially a plug-and-use package like wikipedia which is meant to just call the wikipedia API. For more info on the same read why you should stop using env variables for npm modules.

My proposal for the same would be to have an extra argument on the wikipedia functions - we can introduce this in the base interface so that all the calls will support this.

@mbork your thoughts on this would be appreciated.