Immutable solution version
Adobe PDF Services: use @adobe/pdfservices-node-sdk with ServicePrincipalCredentials
Complete solution
Shows how to fix adobe PDF Services: use @adobe/pdfservices-node-sdk with ServicePrincipalCredentials. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Use @adobe/pdfservices-node-sdk, not the old documentservices-pdftools package name. Gotcha that trips agents: older samples and tutorials use the retired package name @adobe/documentservices-pdftools-node-sdk and JWT service-account credentials.
Steps
- 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.
When to use
You are seeing this: Build credentials with new ServicePrincipalCredentials({ clientId, clientSecret }) from the env vars, matching the quickstart. Use this skill when you run into "Adobe PDF Services: use @adobe/pdfservices-node-sdk with ServicePrincipalCredentials".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
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 2 · 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>