dws-viewer-api
БесплатноЗапускает вложенные скриптыНе проверенUpload documents to Nutrient-managed cloud storage and mint browser viewer session JWTs via the Nutrient DWS Viewer API (cloud-hosted document viewing). Use…
от PSPDFKit-labs★ 18 звёзд на GitHubОб этом скилле
Nutrient DWS Viewer API
The DWS Viewer API is Nutrient's cloud-hosted document viewing service. The flow is three server-side steps: upload a document to Nutrient-managed storage (or reference an app-provided one), mint a short-lived session JWT, and hand that JWT to the browser, where the Nutrient Web SDK renders a full viewer backed by Nutrient infrastructure — storage, streaming, annotation sync, and collaboration, with no viewing/storage servers to run. (You still need a small trusted backend or serverless endpoint to mint the session token — the API key must never reach the browser; this skill is exactly that server-side step.)
This skill covers the server-side half — upload and session mint, the part agents get wrong. The
one-line browser embed (NutrientViewer.load({ container, session })) is documented in
references/embed-guide.md; framework integration belongs to the nutrient-web-sdk skill.
When to use
- "Embed a PDF viewer for document review/approval in our SaaS app — I don't want to run servers."
- "Add annotation, forms, or signing to a document workflow without hosting infrastructure."
- "Mint a viewer session token / session JWT for the browser."
- "Add multi-user real-time annotation to a document, cloud-backed."
Three Nutrient products show documents in a browser. Pick the right one before writing code:
| Product | Infra hosting | Storage | Persistence / collab | Route here when |
|---|---|---|---|---|
| DWS Viewer API (this skill) | Nutrient cloud | Nutrient cloud or app-provided | Built in | Cloud-first; no server infra; collab fast |
Nutrient Web SDK (nutrient-web-sdk) |
Developer (browser WASM) | Developer's server | Via Document Engine | Self-hosted/offline; @nutrient-sdk/viewer embed |
Document Engine (nutrient-document-engine) |
Developer's server | Developer's DB | Yes (server-side) | Self-hosted persistence; custom auth; data residency |
- Route here (DWS Viewer API) when the user wants a cloud-backed viewer fast, does not want to run servers, or needs annotation persistence / real-time collab out of the box.
- Route to
nutrient-web-sdkfor the self-hosted WASM viewer, license keys, orNutrientViewer.load()/@nutrient-sdk/viewerembed wiring without a DWS session. - Route to
nutrient-document-enginefor self-hosted annotation persistence or data-residency / custom-auth backends.
The full comparison and routing rules live in references/viewer-decision-matrix.md (the single
source of truth for this disambiguation).
Setup
The DWS Viewer API is a separate product with its own API key — distinct from the Processor key
(NUTRIENT_API_KEY) and the Extraction key (NUTRIENT_EXTRACT_API_KEY). Do not reuse another
product's key here.
- Get a DWS Viewer API key at https://dashboard.nutrient.io/.
- Export it as
NUTRIENT_DWS_VIEWER_API_KEY:export NUTRIENT_DWS_VIEWER_API_KEY="pdf_live_..." - Run from the directory containing this SKILL.md:
cd <directory containing this SKILL.md> && uv run scripts/viewer-session.py --help
This skill does not silently fall back to NUTRIENT_API_KEY. The Viewer API's wrong-key
behavior is unconfirmed, so a silent fallback could mint a real browser session JWT against the
wrong product/tenant with no signal (a confused-deputy). If your tenant has migrated to a global
DWS key, opt in explicitly with --allow-global-key, which warns at the point of fallback.
Tool preference
scripts/viewer-session.py— the cloud-side operations (upload, session mint, combined).references/embed-guide.md— the browser embed (NutrientViewer.load), CDN snippet, llms.txt pointers, and the pointer tonutrient-web-sdkfor framework recipes.references/viewer-decision-matrix.md— full product decision matrix and routing rules.
Document modes
- DWS-managed — upload the document to Nutrient storage (
upload), then mint a session for itsdocument_id. Nutrient stores, streams, and (optionally) persists annotations. Counts against the upload/storage quota; uploaded documents should be torn down when no longer needed (see Rules). - App-provided — the developer streams their own file to the SDK in the browser; the backend
only mints a session with an empty body (
session --app-provided). No document is uploaded to Nutrient storage, so nothing needs teardown — but each session still consumes session quota.
Operations
viewer-session.py — upload + session mint
# Upload a document to Nutrient storage; prints document_id
uv run scripts/viewer-session.py upload --file doc.pdf
# Mint a read-only session JWT for a DWS-managed document (write the token to a 0600 file)
uv run scripts/viewer-session.py session --document-id <id> --jwt-out session.jwt
# Elevate permissions explicitly (least privilege is the default — see Rules)
uv run scripts/viewer-session.py session --document-id <id> --allow-w
Установить dws-viewer-api в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dws-viewer-api?
Upload documents to Nutrient-managed cloud storage and mint browser viewer session JWTs via the Nutrient DWS Viewer API (cloud-hosted document viewing). Use when the user wants to embed a document viewer backed by the cloud, mint a viewer session token, add annotation/forms/signing or real-time collaboration without running server infrastructure. Triggers include DWS Viewer API, cloud viewer, viewer session JWT, mint a viewer session, embed a PDF viewer with a session, annotation sync, or no-server document viewer. Not for the self-hosted Web SDK (`@nutrient-sdk/viewer` / `NutrientViewer.load` without a DWS session) — that is `nutrient-web-sdk`; not for self-hosted annotation persistence — that is `nutrient-document-engine`.
Как установить скилл dws-viewer-api?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dws-viewer-api запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic