Quickstart: Send your first document for signature

Quickstart5 min read

In this quickstart you send a PDF for signature, mark it as signed, and download the signed copy. Everything runs in test mode, so it is free and no email is sent.

Prerequisites

  • A Notriv account. Create one free.
  • Node.js 18 or later, or any tool that can send HTTP requests (such as curl).
  • Any PDF file.

Send and sign a document

  1. Get a test key

    Sign in and open Developers. Make sure Test mode is selected, choose API keys, then Create test key. Copy the key. It starts with nrv_test_ and is shown only once.

    export NOTRIV_SECRET_KEY=nrv_test_YOUR_KEY
  2. Install the library
    npm install @notriv/node

    Using another language? Skip this step and use the curl tab below.

  3. Send the PDF
    import fs from 'fs'
    import Notriv from '@notriv/node'
    const notriv = new Notriv(process.env.NOTRIV_SECRET_KEY)
    
    const envelope = await notriv.envelopes.create({
      file: fs.readFileSync('contract.pdf'),
      signers: [{ name: 'Jane Doe', email: 'jane@example.com' }],
      signature_page: true,
    })
    console.log(envelope.id, envelope.status)

    signature_page: true adds a page with a signature line for each signer, so any PDF works. You get back an envelope with status sent.

    env_7Kd2mQ9xLp4R2sVt8nB1cW0a sent
  4. Sign it (test mode shortcut)

    In test mode you can sign for everyone with one request instead of opening the signing page:

    await notriv.testHelpers.envelopes.complete(envelope.id)
  5. Download the signed PDF
    const pdf = await notriv.envelopes.download(envelope.id, 'signed')
    fs.writeFileSync('signed.pdf', pdf)
Note
The envelope also appears in your Notriv e-sign list, marked [Test]. To send real documents, create a live key and use it instead. Nothing else in your code changes.

Next steps

Was this page helpful?