@nexis-dev/justsignnow-sdk
v0.2.0
Published
Official TypeScript SDK for the JustSignNow API — electronic signatures with a Bitcoin-anchored audit trail.
Downloads
45
Maintainers
Readme
@nexis-dev/justsignnow-sdk
Official TypeScript SDK for the JustSignNow API — electronic signatures with a Bitcoin-anchored audit trail.
Install
npm install @nexis-dev/justsignnow-sdkQuick start
import { JustSignNow } from '@nexis-dev/justsignnow-sdk'
import fs from 'fs'
const jsn = new JustSignNow(process.env.JSN_API_KEY!)
// 1. Create an editor session — your user picks where to place fields,
// invites signers, and sends from the JustSignNow UI.
const fileBase64 = fs.readFileSync('./permission-slip.pdf').toString('base64')
const session = await jsn.editorSessions.create({
document: { fileBase64, name: 'permission-slip.pdf' },
user: { email: '[email protected]', name: 'Ms. Johnson' },
returnUrl: 'https://schools.app/students/123/forms?signed=1',
metadata: { studentId: 'stu_001', formType: 'permission' },
})
// 2. Show your user the magic link (e.g. as a redirect or a button)
console.log('Editor:', session.editorUrl) // valid 30 min, single-use
// 3. Later — poll the document status (or wait for a webhook)
const status = await jsn.documents.get(session.documentId)
if (status.status === 'completed') {
const { blob: signedPdf } = await jsn.documents.downloadSignedPdf(session.documentId)
const { blob: cert } = await jsn.documents.downloadCertificate(session.documentId)
// save them where you need them
}Configuration
new JustSignNow('jsn_live_xxx', {
baseUrl: 'https://justsignnow.com/api/v1', // override for self-host / staging
fetch: customFetch, // override for tests / non-standard runtimes
})Get an API key at https://justsignnow.com/dashboard/settings.
API surface
| Method | Description |
|--------|-------------|
| editorSessions.create(input) | Create a delegated editor session |
| documents.get(id) | Get document status + signers + audit anchor |
| documents.downloadSignedPdf(id) | Download the completed signed PDF |
| documents.downloadCertificate(id) | Download the standalone certificate |
Full reference + interactive try-it: https://justsignnow.com/docs/api.
Errors
Every non-2xx response throws a JustSignNowError :
import { JustSignNowError } from '@nexis-dev/justsignnow-sdk'
try {
await jsn.documents.get('does-not-exist')
} catch (err) {
if (err instanceof JustSignNowError) {
console.log(err.status) // 404
console.log(err.code) // 'not_found'
console.log(err.message) // human-readable
}
}Compatibility
- Runtime : Node.js 20+, Bun, Cloudflare Workers, Edge runtimes. Uses native
fetchandcrypto.subtle. - Module format : ESM only.
- Types : ships TypeScript declarations.
License
MIT — © Nexis Dev, LLC.
