This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/web/open-a-document/choose-the-right-document-opening-and-loading-setup.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. 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

SetupWhat the client loads withWhat happens before loading
Web SDK with a license keydocument + licenseKeyYour app provides the document directly to Web SDK from a URL, path, Blob, ArrayBuffer, Base64 data, or another supported source.
Web SDK + Document EnginedocumentId + authPayload.jwtYour backend creates or references a document in Document Engine and generates a JWT for the client.
DWS Viewer API with DWS-managed documentssessionYour backend uploads or references a DWS-managed document and creates a document-bound session token.
DWS Viewer API with app-provided documentssession + documentYour 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

NutrientViewer.load({
container: "#nutrient",
document: "/path/to/document.pdf",
licenseKey: "<license_key>",
});

Web SDK + Document Engine

NutrientViewer.load({
container: "#nutrient",
documentId: "<document_id>",
authPayload: { jwt: "<jwt>" },
instant: true,
});

DWS Viewer API with DWS-managed documents

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

DWS Viewer API with app-provided documents

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