The Pactima Node library provides convenient access to the Pactima API from applications written in server-side JavaScript / TypeScript.
See the Pactima's Developer docs for the API reference, guides and examples.
Node 12 or higher.
Install the package with:
npm install @pactima/node
The package needs to be configured with your authentication token which can be an oAuth access token or your team's API key. Require it with the key's value:
const { PactimaApi } = require('@pactima/node');
const pactimaApi = new PactimaApi('pctm_sk_live_...');
pactimaApi.eSignaturePackages.list({ limit: 10 })
.then((res: any) => console.log(res.data))
.catch((err: any) => console.error(err));
Or using ES modules and async
/await
:
import { PactimaApi } from '@pactima/node';
const pactimaApi = new PactimaApi('pctm_sk_live_...');
const res = await pactimaApi.eSignaturePackages.list({ limit: 10 });
console.log(res.data);
New features and bug fixes are released on the latest major version of the @pactima/node
package. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.