Skip to content

Commit 9a086ac

Browse files
committed
Add information about how to run the node samples
1 parent 9c242d2 commit 9a086ac

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,16 @@ You can pass in additional request headers, either individually or in a dictiona
243243
### .responseType()
244244
To set a custom response type, use the `.responseType(string)` method. To see an example, check the [browser sample](samples/browser/index.html) that downloads an image and displays it in an `<img>` element.
245245

246+
## Running node samples
247+
You can run and debug the node samples found under [./samples/node/node-sample.js](./samples/node/node-sample.js) by running the *Run node samples* configuration from the **Debug** (Ctrl + Shift + D) menu in Visual Studio Code. Alternately, you can run the node samples from the CLI by entering `node ./samples/node/node-sample.js` (assuming you are at the root of this repo). You'll need to rename the *secrets.example.json* file to *secrets.json* and add a valid access token to it. You can get an access token by doing the following:
248+
1. Go to [Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer).
249+
2. Login with the account you want to use to run the node samples.
250+
3. Open the F12 dev tools.
251+
4. Type `tokenPlease()` into the console to get an access token.
252+
5. Copy the access token and put it into the *secrets.json* file and save the file.
253+
254+
We suggest that you become acquainted with these samples as they show some of the main use scenarios for this client library.
255+
246256
## Additional information
247257
### Options in `MicrosoftGraph.Client.init()`
248258

0 commit comments

Comments
 (0)