🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@shelf/pspdfkit-ssr

Package Overview
Dependencies
Maintainers
59
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shelf/pspdfkit-ssr

Utilities to work with PSPDFKit's server-side rendering

latest
Source
npmnpm
Version
4.0.1
Version published
Weekly downloads
4
-92.31%
Maintainers
59
Weekly downloads
 
Created
Source

pspdfkit-ssr CircleCI npm (scoped)

Install

$ yarn add @shelf/pspdfkit-ssr

Usage

const {createReadStream} = require('fs');
const {uploadPDF, getJWTForDocumentPreview} = require('@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

Keywords

pspdfkit

FAQs

Package last updated on 13 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts