---
title: "Choose the right document opening and loading setup"
canonical_url: "https://www.nutrient.io/guides/web/open-a-document/choose-the-right-document-opening-and-loading-setup/"
md_url: "https://www.nutrient.io/guides/web/open-a-document/choose-the-right-document-opening-and-loading-setup.md"
last_updated: "2026-06-16T17:10:34.882Z"
description: "Compare Web SDK with a license key, Web SDK with Document Engine, and DWS Viewer API document-loading workflows so you can choose the right setup."
---

# Choose the right document opening and loading setup

Opening or loading a document follows the same high-level workflow across Nutrient Web SDK, Document Engine, and DWS Viewer API:

1. Make the document available to the product you’re using.

2. Get the identifier or credential the client needs.

3. Load the document with the correct Web SDK configuration.

## The same workflow in each setup

| Setup                                      | What the client loads with       | What happens before loading                                                                                                       |
| ------------------------------------------ | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| Web SDK with a license key                 | `document` + `licenseKey`        | Your app provides the document directly to Web SDK from a URL, path, Blob, ArrayBuffer, Base64 data, or another supported source. |
| Web SDK + Document Engine                  | `documentId` + `authPayload.jwt` | Your backend creates or references a document in Document Engine and generates a JWT for the client.                              |
| DWS Viewer API with DWS-managed documents  | `session`                        | Your backend uploads or references a DWS-managed document and creates a document-bound session token.                             |
| DWS Viewer API with app-provided documents | `session` + `document`           | Your backend creates a DWS Viewer API browser session, and your frontend passes the document directly to Web SDK.                 |

## Minimal loading examples

For each setup, the client-side loading code is similar, but the parameters passed to `NutrientViewer.load()` differ based on the workflow.

### Web SDK with a license key

```js

NutrientViewer.load({
  container: "#nutrient",

  document: "/path/to/document.pdf",
  licenseKey: "<license_key>",
});

```

### Web SDK + Document Engine

```js

NutrientViewer.load({
  container: "#nutrient",

  documentId: "<document_id>",
  authPayload: { jwt: "<jwt>" },
  instant: true,
});

```

### DWS Viewer API with DWS-managed documents

```js

NutrientViewer.load({
  container: "#nutrient",

  session: "<session_token>",
});

```

### DWS Viewer API with app-provided documents

```js

NutrientViewer.load({
  container: "#nutrient",

  session: "<session_token>",
  document: "/path/to/document.pdf",
});

```

## How to choose the right flow

Use **Web SDK with a license key** when your app already controls document delivery and authorization and the browser can open the document directly.

Use **Web SDK + Document Engine** when you want your own self-hosted backend for document storage, streaming, permissions, synchronization, or collaboration.

Use **DWS Viewer API with DWS-managed documents** when you want Nutrient’s hosted service to store, stream, and manage documents for Web SDK.

Use **DWS Viewer API with app-provided documents** when your app or browser already has the document, but you want DWS Viewer API to authorize and meter the viewer session.

## Common points of confusion

- `document` is the Web SDK option for documents provided by your app or browser.

- `licenseKey` is used for licensed Web SDK deployments, but it’s omitted when a DWS Viewer API session authorizes the load.

- `documentId` + `authPayload.jwt` is the standard Document Engine-backed loading option.

- `session` is the DWS Viewer API loading option for DWS-managed documents.

- `session` + `document` is the DWS Viewer API loading option for app-provided documents.

- Uploading, creating, or referencing a server-managed document is a backend step; calling `NutrientViewer.load()` is the client step.

## Equivalent guides by product

- **Web SDK**
  - [Open documents overview](https://www.nutrient.io/guides/web/open-a-document.md)
  - [Open documents from Document Engine](https://www.nutrient.io/guides/web/open-a-document/from-document-engine.md)
  - [Open PDFs using DWS Viewer API](https://www.nutrient.io/guides/web/open-a-document/from-dws-viewer-api.md)

- **Document Engine**
  - [Create a document from an upload](https://www.nutrient.io/guides/document-engine/file-management/create-a-document-from-upload.md)
  - [Generate a JWT](https://www.nutrient.io/guides/document-engine/viewer/client-authentication/generate-a-jwt.md)

- **DWS Viewer API**
  - [Upload documents](https://www.nutrient.io/guides/dws-viewer/developer-guides/upload-documents.md)
  - [Generate a session token](https://www.nutrient.io/guides/dws-viewer/developer-guides/generate-a-session-token.md)
  - [Open DWS-managed documents in Web SDK](https://www.nutrient.io/guides/dws-viewer/developer-guides/open-a-document-in-web.md)
  - [Open app-provided documents in Web SDK](https://www.nutrient.io/guides/dws-viewer/developer-guides/open-client-provided-documents.md)
---

## Related pages

- [Open PDFs from an ArrayBuffer using JavaScript](/guides/web/open-a-document/from-arraybuffer.md)
- [Open and display PDFs from a Blob using JavaScript](/guides/web/open-a-document/from-blob.md)
- [Open PDFs from Base64 in the browser using JavaScript](/guides/web/open-a-document/from-base64-data.md)
- [Open documents from Document Engine](/guides/web/open-a-document/from-document-engine.md)
- [Open local PDF files using JavaScript](/guides/web/open-a-document/from-local-storage.md)
- [Open PDFs using DWS Viewer API](/guides/web/open-a-document/from-dws-viewer-api.md)
- [Open and display PDF files from a remote URL using JavaScript](/guides/web/open-a-document/from-remote-url.md)
- [Open Base64 image files using JavaScript](/guides/web/open-a-document/image-from-base64-data.md)
- [Open image files from a Blob using JavaScript](/guides/web/open-a-document/image-from-blob.md)
- [Open image files from an array buffer using JavaScript](/guides/web/open-a-document/image-from-arraybuffer.md)
- [Open local image files using JavaScript](/guides/web/open-a-document/image-from-local-storage.md)
- [Open image files from a URL using JavaScript](/guides/web/open-a-document/image-from-remote-url.md)
- [Open and display PDFs in the browser using JavaScript](/guides/web/open-a-document.md)
- [Open Base64 MS Office files using JavaScript](/guides/web/open-a-document/office-from-base64-data.md)
- [Open MS Office files from a Blob using JavaScript](/guides/web/open-a-document/office-from-blob.md)
- [Open MS Office files from an ArrayBuffer using JavaScript](/guides/web/open-a-document/office-from-arraybuffer.md)
- [Open local MS Office files using JavaScript](/guides/web/open-a-document/office-from-local-storage.md)
- [Temporary storage for PDF downloads](/guides/web/open-a-document/temp-storage.md)
- [Open MS Office files from a URL using JavaScript](/guides/web/open-a-document/office-from-remote-url.md)
- [Opening specific pages in PDFs using JavaScript](/guides/web/features/open-parameters.md)

