Skip to content

Commit

Permalink
Update client.js
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutiburman committed Nov 23, 2023
1 parent 1c79ce7 commit 4dee264
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/use-cases/data-residency-set-hostname.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ sgMail.send(msg);

## Limitations

1. Emails can only be sent to two hosts for now; 'eu' (https://api.eu.sendgrid.com/) and 'global' (https://api.eu.sendgrid.com/)
1. Setting the API Key (via `client.setApiKey()`) or Twilio Authentication (via `client.setTwilioEmailAuth()`) will override the hostname to default value. Use the setter call after this set-up.
2. Emails can only be sent to two hosts for now; 'eu' (https://api.eu.sendgrid.com/) and 'global' (https://api.eu.sendgrid.com/)
2. The default hostname is https://api.sendgrid.com/
3. The valid values for `region` in `client.setDataResidency(region)` are only `eu` and `global`. Case-sensitive.
2 changes: 2 additions & 0 deletions packages/client/src/classes/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class Client {

setApiKey(apiKey) {
this.auth = 'Bearer ' + apiKey;
console.log('baseUrl: ');
console.log(this.request.baseUrl);
this.setDefaultRequest('baseUrl', SENDGRID_BASE_URL);

if (!this.isValidApiKey(apiKey)) {
Expand Down

0 comments on commit 4dee264

Please sign in to comment.