Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
shelfioPublic archive

About

Utilities to work with PSPDFKit's server-side rendering

Topics

Resources

Stars

2 stars

Watchers

19 watching

Forks

Repository files navigation

pspdfkit-ssr CircleCI npm (scoped)

Install

$ npm install @shelf/pspdfkit-ssr

Usage

import {createReadStream} from 'fs';
import {uploadPDF, getJWTForDocumentPreview} from '@shelf/pspdfkit-ssr';

const documentId = await uploadPDF({
  documentId: 'some-custom-document-id',
  fileStream: createReadStream('./file.pdf'),
  fileSize: 1024,
});

const jwt = getJWTForDocumentPreview(documentId);

Note: this library relies upon following environment variables:

  • PSPDFKIT_SERVER_URL
  • PSPDFKIT_SERVER_AUTH_TOKEN
  • PSPDFKIT_SERVER_JWT_KEY
  • PSPDFKIT_SERVER_JWT_PASSPHRASE

Note: this library tries to be idempotent. Unlike PSPDFKit server, it catches errors when document with provided ID was already uploaded.

See Client Authentication section of PSPDFKit documentation for details.

Publish

  • Run sudo npx np, follow interactive UI. Please select appropriate version bump according to semver.

  • After redirect to the prepared release of the early published package just press button Publish release

License

MIT © Shelf

About

Utilities to work with PSPDFKit's server-side rendering

Topics

Resources

Stars

2 stars

Watchers

19 watching

Forks

Releases

Packages

Contributors

Languages