From 42cf52827226fab040277d346b82e2d7ad39c989 Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Tue, 8 Jun 2021 12:00:48 -0700 Subject: [PATCH] Adding `customHosts` change --- changelogs/v3-upgrade-guide.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/changelogs/v3-upgrade-guide.md b/changelogs/v3-upgrade-guide.md index d7217256c..c2e525a85 100644 --- a/changelogs/v3-upgrade-guide.md +++ b/changelogs/v3-upgrade-guide.md @@ -66,6 +66,17 @@ ### Added `browser` field in package.json. - The `browser` field indicates the entry point for client applications using Microsoft Graph JS SDK library. +### Added `customHosts` options +- The `AuthenticationHandler` and `TelemetryHandler` will add or update the request headers only if the request URL is a Graph endpoint or a custom endpoint. +- `customHosts` property in `IOptions`, `IClientOptions` takes in a `Set` of custom hosts. + +```typescript +// Consider the custom request url is https://CUSTOM_HOST.com +const customHost = "CUSTOM_HOST"; +const customHosts = new Set([customHost]); +const client = Client.initWithMiddleware({ middleware, customHosts }); +``` + ### Added `GraphClientError` - `GraphClientError` handles client-side errors encountered within the JavaScript Client SDK whereas, `GraphError` class should be used to handle errors in the response from the Graph API.