-
Notifications
You must be signed in to change notification settings - Fork 231
Microsoft Graph JavaScript SDK V3.0 Upgrade Guide
Roina Atieno Ochieng edited this page May 12, 2021
·
1 revision
- Microsoft Graph JS SDK requires Node.js 10 LTS or higher.
- Updated to TypeScript 4.x.
- Modified the
FileObject
interface which now contains thesliceFile
function. Learn more LargeFileUploadTask. - The
FileObject
instance passed on creation of theLargeFileUploadTask
object should contain the implementation of thesliceFile
function. - Added new classes
FileUpload
andStreamUpload
implementing theFileObject
interface.
- Recommended way is to cancel a request by passing a signal.
{
"main": "lib/src/index.js",
"module": "lib/es/src/index.js",
"browser": {
"./lib/es/src/index.js": "./lib/es/src/browser/index.js"
}
}
-
graph-es-sdk.js
- the bundled file in ES format will not be shipped anymore as the ES modules are being shipped. -
graph-js-sdk.js
will be shipped as is.
- Files in
lib/es
have been moved tolib/es/src
. Thelib
folder contains the transpiledsrc
files.- The
lib
contains the ES and CJS modules as follows:
lib │ └─── src (CJS modules) | │ └─── es |___ src (ES modules)
- The
-
Range
:src/Range
changed tosrc/tasks/FileUploadTask/Range
. -
ImplicitMSALAuthenticationProvider
:-
src/ImplicitMSALAuthenticationProvider
changed tosrc/authentication/msal/ImplicitMSALAuthenticationProvider
. - Alternatively,
ImplicitMSALAuthenticationProvider
can be imported or required from@microsoft/microsoft-graph-client/authProviders/msal
.
-
-
MSALAuthenticationProviderOptions
:-
src/MSALAuthenticationProviderOptions
changed tosrc/authentication/msal/MSALAuthenticationProviderOptions
. - Alternatively,
MSALAuthenticationProviderOptions
can be imported or required from@microsoft/microsoft-graph-client/authProviders/msal
.
-
- Added a
TokenCredentialAuthenticationProvider
enabling the use of@azure/identity
credential classes
for authentication purposes. - The
TokenCredentialAuthenticationProvider
enables server-side authentication usingcredential classes
such asClientSecretCredential
orClientCertificateCredential
. - Find the samples on how to use
TokenCredentialAuthenticationProvider
here - TokenCredentialAuthenticationProvider samples
- Added support for Node.js Stream upload. Learn more LargeFileUploadTask.
- Added capabilities to track the upload progress using
UploadEventHandlers
. - Resolved a bug to enable large file uploads to Outlook and Print APIs.
- The
browser
field indicates the entry point for client applications using Microsoft Graph JS SDK library.
-
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.
- Use of
ImplicitMSALAuthenticationProvider
, that is,using the implicit authorization flow is not recommended any more. OAuth 2.0 Implicit Grant. - Alternatives to
ImplicitMSALAuthenticationProvider
-- TokenCredentialAuthenticationProvider with the
azure/identity
library. Learn more about InteractiveBrowserCredential - A CustomAuthenticationProvider with an auth library of your choice. Choose a Microsoft Graph authentication provider based on scenario
- TokenCredentialAuthenticationProvider with the
- The
sliceFile
function has been moved to theFileObject
interface.