trustpilot / node-trustpilot

HTTP client for Trustpilot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove username and password

anjmao opened this issue · comments

As we already have api keys management in B2B site I think we should to remove username and password fields from api.

let client = new Trustpilot(
  {
    apiKey: 'YOUR-API-KEY',
    secret: 'YOUR-SECRET',
    username: 'YOUR-TRUSTPILOT-B2B-USERNAME', // <-remove this
    password: 'YOUR-TRUSTPILOT-B2B-PASSWORD' // <-remove this
  });

Note: this is breaking change and release number should be updated accordingly to follow semver.

This package is not only used for our b2b site. Other users outside of TP are also using this module, and username and password are needed in cases, when they want to access the private endpoints.

However, I would like to see the AccessProvider was more modular, so it was possible to change to a different provider. Say a b2b AccessProvider which could accept an apiKey and an accessToken, and that provider could also handle refreshToken communication if needed.
Another example could be, another simpler AccessProvider, that only allowed accessing public API endpoints.

@anjmao Does Bardur answer it? Can I close the issue?

@martinbuberl guess we can close this issue.