Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions 62 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,26 @@
[![npm version badge](https://img.shields.io/npm/v/@microsoft/microsoft-graph-client.svg?maxAge=86400)](https://www.npmjs.com/package/@microsoft/microsoft-graph-client)
[![Travis](https://travis-ci.org/microsoftgraph/msgraph-sdk-javascript.svg?branch=master&style=flat-square)](https://travis-ci.org/microsoftgraph/msgraph-sdk-javascript)

The Microsoft Graph JavaScript client library is a lightweight wrapper around the Microsoft Graph API that supports both Node and the browser. See the [samples](samples) folder for code examples. You can also use our [TypeScript graph types](https://github.com/microsoftgraph/msgraph-typescript-typings) with this library. We love your feedback! You can file an issue in this repository or write on our [UserVoice page](https://officespdev.uservoice.com/).
The Microsoft Graph JavaScript client library is a lightweight wrapper around the Microsoft Graph API that can be used server-side and in the browser. See the [samples](samples) folder for code examples. You can also use our [TypeScript graph types](https://github.com/microsoftgraph/msgraph-typescript-typings) with this library. We love your feedback! You can file an issue in this repository or write on our [UserVoice page](https://officespdev.uservoice.com/).

**Looking for IntelliSense on models (Users, Groups, etc.)? Check out the [Microsoft Graph Types](https://github.com/microsoftgraph/msgraph-typescript-typings) repository!**

[![TypeScript demo](https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-javascript/master/types-demo.PNG)](https://github.com/microsoftgraph/msgraph-typescript-typings)

## Installation
### Node
You can find installation instructions at the [Node.js website](https://nodejs.org/).
1) Install [Node.js and npm](https://nodejs.org/).

```npm install @microsoft/microsoft-graph-client```
2) ```npm install @microsoft/microsoft-graph-client```

Include the library in your JavaScript file with `const MicrosoftGraph = require("@microsoft/microsoft-graph-client");`
3) Include the library in your JavaScript file with `const MicrosoftGraph = require("@microsoft/microsoft-graph-client");`

### Browser

Include [lib/graph-js-sdk-web.js](https://github.com/microsoftgraph/msgraph-sdk-javascript/raw/master/lib/graph-js-sdk-web.js) in your page.
```html
<script type="text/javascript" src="graph-js-sdk-web.js"></script>
```
## Changelog

#### 1.0.0
* Added tests for new Graph functionality - Delta query, Extensibility, OneNote, and more.

#### 0.4.0
* Add support for ES5. Make sure to use `graph-js-sdk-web.js` for web apps
* Removed iterator helper method.

#### 0.3.1
* Support for Node.js versions 4 and 5

#### 0.3.0
* Migrated away from typings in client library core and TypeScript sample

#### 0.2.2
* Updated SuperAgent to version ``` 3.3.0 ```

#### 0.2.0
* **Breaking change for existing apps** - Initialize the client library with `MicrosoftGraph.Client.init({...})`. See the updated usage section below for code samples.
* Added response handling tests to simulate Graph calls
* Added type declarations file for core client library, which adds intellisense for chained methods.


## Usage
### Initialize client with access token provider
Expand All @@ -65,8 +46,6 @@ All calls to Microsoft Graph are chained together starting with `client.api(path
* https://graph.microsoft.com/beta/me
* me/events?$filter=startswith(subject, 'ship')

For more examples of accepted paths, see the [test cases](tests/urlParsing.js).

```javascript
// Example calling /me with no parameters
client
Expand Down Expand Up @@ -324,6 +303,29 @@ We'd love to get your feedback about the Microsoft Graph JavaScript client libra

## Contributing
Please see the [contributing guidelines](CONTRIBUTING.md).
## Changelog

#### 1.0.0
* Added tests for new Graph functionality - Delta query, Extensibility, OneNote, and more.

#### 0.4.0
* Add support for ES5. Make sure to use `graph-js-sdk-web.js` for web apps
* Removed iterator helper method.

#### 0.3.1
* Support for Node.js versions 4 and 5

#### 0.3.0
* Migrated away from typings in client library core and TypeScript sample

#### 0.2.2
* Updated SuperAgent to version ``` 3.3.0 ```

#### 0.2.0
* **Breaking change for existing apps** - Initialize the client library with `MicrosoftGraph.Client.init({...})`. See the updated usage section below for code samples.
* Added response handling tests to simulate Graph calls
* Added type declarations file for core client library, which adds intellisense for chained methods.


## Additional resources

Expand All @@ -334,4 +336,4 @@ Please see the [contributing guidelines](CONTRIBUTING.md).
* [Office Dev Center](http://dev.office.com/)

## Copyright
Copyright (c) 2016 Microsoft. All rights reserved.
Copyright (c) Microsoft Corporation. All rights reserved.
Binary file added BIN +33.5 KB types-demo.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.