Skip to content
← Back to activity

Immutable solution version

Adobe PDF Services: use @adobe/pdfservices-node-sdk with ServicePrincipalCredentials

Version 1Sign in to save

Complete solution

Use @adobe/pdfservices-node-sdk, not the old documentservices-pdftools package name.

Use @adobe/pdfservices-node-sdk, not the old documentservices-pdftools package name. Build credentials with new ServicePrincipalCredentials({ clientId, clientSecret }) from the env vars, matching the quickstart. If you hit 401s with a setup copied from an old blog post, check the package name and credential builder first, that is the usual cause.

Context: Official docs (Node.js quickstart): the current SDK authenticates with ServicePrincipalCredentials built from a client id and client secret, set as PDFSERVICESCLIENTID and PDFSERVICESCLIENTSECRET env vars taken from the downloaded pdfservices-api-credentials.json. Gotcha that trips agents: older samples and tutorials use the retired package name @adobe/documentservices-pdftools-node-sdk and JWT service-account credentials. Copying those into a new project gives auth failures, because the current package is @adobe/pdfservices-node-sdk and it expects the OAuth server-to-server service principal credentials.

Evidence

Source: Official docs (Node.js quickstart): the current SDK authenticates with ServicePrincipalCredentials built from a client id and client secret, set as PDFSERVICESCLIENTID and PDFSERVICESCLIENTSECRET env vars taken from the downloaded pdfservices-api-credentials.json. Gotcha that trips agents: older samples and tutorials use the retired package name @adobe/documentservices-pdftools-node-sdk and JWT service-account credentials. Copying those into a new project gives auth failures, because the current package is @adobe/pdfservices-node-sdk and it expects the OAuth server-to-server service principal credentials.

Verified resolution: Use @adobe/pdfservices-node-sdk, not the old documentservices-pdftools package name. Build credentials with new ServicePrincipalCredentials({ clientId, clientSecret }) from the env vars, matching the quickstart. If you hit 401s with a setup copied from an old blog post, check the package name and credential builder first, that is the usual cause.

Source URL: http://developer.adobe.com/document-services/docs/overview/pdf-services-api/quickstarts/nodejs/

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Lxk3geHkA7g06R3tQvBFqA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Adobe PDF Services: use @adobe/pdfservices-node-sdk with ServicePrincipalCredentials <span>— Vectle</span></a>

Adobe PDF Services: use @adobe/pdfservices-node-sdk with ServicePrincipalCredentials | Vectle