{"id":11519,"library":"pandadoc-node-client","title":"PandaDoc Node.js SDK","description":"The `pandadoc-node-client` is the official Node.js SDK for interacting with the PandaDoc API. It provides a comprehensive set of functionalities to programmatically manage documents, templates, content library items, webhooks, and other core PandaDoc resources directly from a Node.js environment. The current stable major version is 6.2.0, with version 7.x actively under development in release candidate stages, which introduces significant new features like a Content Library API and improved document section management. The SDK is generated to align with the PandaDoc OpenAPI Specification, ensuring it remains up-to-date with underlying API changes. Its release cadence is primarily driven by API updates and the introduction of new platform features rather than a fixed schedule. As an official SDK, it offers a reliable, type-safe experience for TypeScript users, providing robust auto-completion and compile-time checks, positioning it as a well-supported integration tool.","status":"active","version":"6.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/PandaDoc/pandadoc-api-node-client","tags":["javascript","PandaDoc","SDK","typescript"],"install":[{"cmd":"npm install pandadoc-node-client","lang":"bash","label":"npm"},{"cmd":"yarn add pandadoc-node-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add pandadoc-node-client","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Used to configure the SDK client with API key and other settings. Since v6, this package primarily targets ESM, though CJS may work via transpilation. Use `import` for best practice.","wrong":"const Configuration = require('pandadoc-node-client').Configuration;","symbol":"Configuration","correct":"import { Configuration } from 'pandadoc-node-client';"},{"note":"This is a key service class for interacting with document-related endpoints. All API service classes are named imports.","wrong":"import DocumentsApi from 'pandadoc-node-client/dist/documents';","symbol":"DocumentsApi","correct":"import { DocumentsApi } from 'pandadoc-node-client';"},{"note":"TypeScript types for request bodies and response payloads are exported directly from the package, enabling strong type checking.","symbol":"CreateDocumentFromTemplateRequest","correct":"import { CreateDocumentFromTemplateRequest } from 'pandadoc-node-client';"}],"quickstart":{"code":"import { Configuration, DocumentsApi } from 'pandadoc-node-client';\n\nconst PANDADOC_API_KEY = process.env.PANDADOC_API_KEY ?? '';\n\nasync function listPandaDocDocuments() {\n  if (!PANDADOC_API_KEY) {\n    console.error('PANDADOC_API_KEY environment variable is not set.');\n    process.exit(1);\n  }\n\n  const config = new Configuration({\n    apiKey: PANDADOC_API_KEY,\n    basePath: 'https://api.pandadoc.com'\n  });\n\n  const documentsApi = new DocumentsApi(config);\n\n  try {\n    console.log('Fetching PandaDoc documents...');\n    const response = await documentsApi.listDocuments();\n    console.log(`Successfully retrieved ${response.results?.length ?? 0} documents.`);\n    if (response.results && response.results.length > 0) {\n      console.log('First document ID:', response.results[0].id);\n      console.log('First document Name:', response.results[0].name);\n    }\n    return response.results;\n  } catch (error) {\n    console.error('Failed to fetch documents:', error);\n    if (error.response?.data) {\n      console.error('API Error Details:', error.response.data);\n    }\n    throw error;\n  }\n}\n\nlistPandaDocDocuments();","lang":"typescript","description":"Demonstrates initializing the PandaDoc client with an API key and fetching a list of existing documents."},"warnings":[{"fix":"Review the full changelog for v7.0.0-rc.1 and later RCs, especially regarding changes to content library, document sections, and auto reminders APIs. Migrate code carefully and test thoroughly before deploying to production.","message":"Version 7.0.0-rc.1 and subsequent release candidates introduce significant breaking changes and major new features. It updates the client to match OpenAPI Specification version 7.15.0, resulting in potential API endpoint and payload changes.","severity":"breaking","affected_versions":">=7.0.0-rc.1"},{"fix":"For production applications, it is recommended to stick with the latest stable 6.x release until version 7.0.0 is officially released. If using 7.x RCs, pin exact versions to avoid unexpected changes from subsequent RCs.","message":"The 7.x series is currently in release candidate (RC) status. While actively developed, it should be used with caution in production environments as APIs and behavior may still change before the final stable release.","severity":"gotcha","affected_versions":">=7.0.0-rc.1"},{"fix":"Adjust document creation payloads to account for the `name` field becoming optional and consider using `detect_title_variables` if dynamic titles are required. Review API calls related to document creation from templates.","message":"In version 6.0.0, the `name` field for the 'create document from template' payload became optional, and `detect_title_variables` was added as an optional parameter to detect variables in the document name.","severity":"breaking","affected_versions":">=6.0.0 <7.0.0-rc.1"},{"fix":"Always review the changelog and the official PandaDoc API documentation when upgrading to new major versions of the SDK. Leverage TypeScript to catch type mismatches during development.","message":"This SDK is an OpenAPI generated client. Major version updates in the underlying PandaDoc API specification can lead to breaking changes in the SDK's methods, parameters, and return types, even if not explicitly highlighted in the changelog as 'breaking'.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure the `apiKey` property in your `Configuration` object is set to a valid, active PandaDoc API key. Check your PandaDoc developer settings for the correct key.","cause":"The API key configured for the client is either missing, incorrect, or has expired.","error":"PandaDoc API Error: Authentication failed. Invalid API key provided."},{"fix":"Always instantiate API service classes using the `new` keyword: `const documentsApi = new DocumentsApi(config);`. Ensure you are using ESM `import` statements if targeting modern Node.js environments.","cause":"Attempting to call an API service class (e.g., `DocumentsApi`) as a function instead of instantiating it with `new`, or incorrect `require` usage for an ESM-first package.","error":"TypeError: Class constructor DocumentsApi cannot be invoked without 'new'"},{"fix":"Consult the `CreateDocumentFromTemplateRequest` (or relevant) TypeScript interface in the SDK's types, and the PandaDoc API documentation, to ensure your payload object strictly adheres to the required structure and types.","cause":"The object provided as an argument to an API method does not match the expected TypeScript interface for that request payload.","error":"TS2345: Argument of type '{ /* ... */ }' is not assignable to parameter of type 'CreateDocumentFromTemplateRequest'."}],"ecosystem":"npm"}