trustpilot / node-trustpilot

HTTP client for Trustpilot
MIT License
31 stars 4 forks source link

BaseURL is not set by default, even for non-invitation API #86

Open DimosthenisK opened 2 years ago

DimosthenisK commented 2 years ago

Based on the Readme file, it is expected that by default the baseUrl property is set to "https://api.trustpilot.com", and you only need to change it only in case you're using the invitation API.

In reality, you always need to set the baseUrl property, or else you'll be getting "Invalid URL" errors if you follow the Readme examples.

The "Basic Usage"/"Usage with OAuth" examples should be changed to include the baseUrl property.

KevinDanikowski commented 1 year ago

Thank you!!

const client = await new TrustpilotApi({
      key: 'xxx',
      secret: 'xxx',
      grantType: GrantType.client_credentials,
      baseUrl: 'https://api.trustpilot.com',
    }).authenticate()

finally worked