---
title: "Open a document in Web SDK"
canonical_url: "https://www.nutrient.io/guides/dws-viewer/developer-guides/open-a-document-in-web/"
md_url: "https://www.nutrient.io/guides/dws-viewer/developer-guides/open-a-document-in-web.md"
last_updated: "2026-05-30T02:20:01.289Z"
description: "Learn how to open a document using Nutrient Web SDK with session token authentication and proper configuration."
---

# Open a document in Web SDK

To load a document from DWS Viewer API, pass the document’s session token for authentication in the [configuration](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html) object passed to [`NutrientViewer.load()`](https://www.nutrient.io/api/web/NutrientViewer.html#.load):

## Requirements

DWS Viewer API requires Nutrient Web SDK versions 1.1.1 or later.

## Usage

```js

NutrientViewer.load({
  container: "<container>",
  session: "<session_token>",
});

```

The [`<container>`](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html#container) placeholder in the code above should be replaced by a CSS selector or a DOM element where Nutrient Web SDK will be mounted.

The [`<session_token>`](https://www.nutrient.io/guides/dws-viewer/developer-guides/generate-a-session-token/) placeholder should be replaced by the session token obtained from the DWS Viewer API [dashboard](https://dashboard.nutrient.io/), or through its [API](https://www.nutrient.io/api/reference/viewer/public/). Session tokens are used for authenticating Nutrient Web SDK clients when connecting to DWS Viewer API.

> When using DWS Viewer API, documents must be loaded using session tokens (not document URLs). Documents need to exist in DWS before you can generate session tokens for them and open them in Web SDK. This is different from loading local documents, where you’d use the `document` property.

## Integration overview

To integrate with DWS Viewer API, you need to:

1. **Upload your document** — First, [upload your document](https://www.nutrient.io/guides/dws-viewer/developer-guides/upload-documents.md) to DWS and obtain the document ID.

2. **Generate a session token** — Use the document ID to [generate a session token](https://www.nutrient.io/guides/dws-viewer/developer-guides/generate-a-session-token.md).

3. **Open the document in Web SDK** — Use the session token to open the document in Nutrient Web SDK.

For a complete server implementation example, refer to the [Node.js integration example](https://www.nutrient.io/guides/dws-viewer/examples/nodejs-integration-example.md) guide.

## Related guides

Refer to the following additional guides:

- [Nutrient Web SDK getting started guides](https://www.nutrient.io/sdk/web/getting-started.md)

- [Nutrient Web SDK detailed documentation](https://www.nutrient.io/guides/web/intro.md)

- [Nutrient Web SDK API reference](https://www.nutrient.io/api/web/)
---

## Related pages

- [Dashboard](/guides/dws-viewer/developer-guides/dashboard.md)
- [Generate a session token](/guides/dws-viewer/developer-guides/generate-a-session-token.md)
- [DWS Viewer API developer guides](/guides/dws-viewer/developer-guides.md)
- [Architecture of DWS Viewer API integration](/guides/dws-viewer/developer-guides/architecture.md)
- [Upload documents](/guides/dws-viewer/developer-guides/upload-documents.md)
- [DWS Viewer API backend authentication](/guides/dws-viewer/developer-guides/backend-authentication.md)
- [Deployment options](/guides/dws-viewer/developer-guides/deployment-options.md)
- [Integrate DWS Viewer API with your own backend](/guides/dws-viewer/developer-guides/use-with-your-backend.md)
- [DWS Viewer API client authentication flow](/guides/dws-viewer/developer-guides/client-authentication-flow.md)

