The Immersive Reader SDK is a JavaScript library that allows you to easily and quickly integrate the Immersive Reader into your web application.
Usage of this SDK requires an Azure subscription to Immersive Reader. Create an Immersive Reader resource in the Azure portal.
Once you have a subscription key, use that to acquire an access token by following these steps.
Include the library in your web application:
- Stable build
<script type='text/javascript' src='https://contentstorage.onenote.office.net/onenoteltir/immersivereadersdk/immersive-reader-sdk.0.0.1.js'></script>
npm install @microsoft/immersive-reader-sdk
yarn add @microsoft/immersive-reader-sdk
- Canary build (use at your own risk!)
<script type='text/javascript' src='https://contentstorage.onenote.office.net/onenoteltir/immersivereadersdk/immersive-reader-sdk.preview.js'></script>
npm install @microsoft/immersive-reader-sdk@next
yarn add @microsoft/immersive-reader-sdk@next
Add an HTML element to your webpage with the immersive-reader-button
class attribute.
<div class='immersive-reader-button' onclick='launchImmersiveReader()'></div>
Next, invoke the Immersive Reader when the button is clicked:
function launchImmersiveReader() {
const content = {
title: 'Immersive Reader',
chunks: [ {
content: 'Hello, world!'
} ]
};
ImmersiveReader.launchAsync(YOUR_TOKEN, null, content);
}
Take a look at the samples for examples of a full end-to-end integration.
In order to build the SDK, ensure that you have Git, Node.js, and Yarn installed.
Clone a copy of the repo:
git clone https://github.com/Microsoft/immersive-reader-sdk
Change to the immersive-reader-sdk directory:
cd immersive-reader-sdk
Install dependencies:
yarn
Build and test:
yarn run build
yarn run test
We welcome contributions to this project.
- Submit bugs and help us verify fixes as they are checked in.
- Submit and review source code changes.
- Join the discussion on StackOverflow and Twitter.
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.