Getting the error - " Client is not defined "
Hello guys, Im new at Microsoft Graph and Im trying to use it to create new users (Im a tester/developer writing code for cypress). I adapted the following code from one of the Microsoft Graph pages: const options = { token, }; const client = Client.init(options); const user = { accountEnabled: true, displayName: "Adele Vance", mailNickname: "AdeleV", userPrincipalName: "AdeleV@Company portal .onmicrosoft.com", "passwordProfile" : { forceChangePasswordNextSignIn: true, password: "xWwvJ]6NMw+bWH-d" } }; let res = client.api('/users') .post(user); but when I run it with cypress, i get the error: " Client is not defined " which would look to me that its missing a library. So, I did some research on what microsoft graph uses as library and came up with this page: https://github.com/microsoftgraph/msgraph-sdk-javascript and followed the instructions to install the libraries on Visual Studio Code (javascript). I used this line: npm install @microsoft/microsoft-graph-client and then added this to commands,js : import "isomorphic-fetch"; import { Client } from "@microsoft/microsoft-graph-client"; I'm still getting the same error = " Client is not defined " What am I missing? Thanks!