{"_id":"@a11yfy/sdk","_rev":"4-bc9a501de855cb2d4a15d5b18c492f16","name":"@a11yfy/sdk","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.0-placeholder":{"name":"@a11yfy/sdk","version":"0.0.0-placeholder","keywords":["a11yfy","accessibility","pdf","pdf-ua","eaa","sdk"],"license":"MIT","_id":"@a11yfy/sdk@0.0.0-placeholder","maintainers":[{"name":"zoli211","email":"support@a11yfy.com"}],"homepage":"https://a11yfy.com","bugs":{"url":"https://github.com/a11yfy/a11yfy/issues"},"dist":{"shasum":"6859386361e49b07b880f3a67bd23be088ec1704","tarball":"https://registry.npmjs.org/@a11yfy/sdk/-/sdk-0.0.0-placeholder.tgz","fileCount":2,"integrity":"sha512-5IQrq4XVVVrCxhq1gq0Ufl1rRv3wCIFazDIlzbaEpQD3tKQTmtLHRGmE8CnBEHyddmuBmCkdEgIEq2xi8cukIw==","signatures":[{"sig":"MEUCIANNPj26cMdXQuvXZMv5+ytYktuLonxac0eUKcxWHL2yAiEAiQHmRZV6QChCKoA4PsB5Be/jsMP/5JcyKzemmoLm+kg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":554},"_npmUser":{"name":"zoli211","email":"support@a11yfy.com"},"repository":{"url":"git+https://github.com/a11yfy/a11yfy.git","type":"git"},"_npmVersion":"10.9.7","description":"a11yfy SDK — reserved for the official a11yfy accessible-document API client. Coming soon.","directories":{},"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.0-placeholder_1780271081285_0.6445944937771328","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@a11yfy/sdk","version":"0.1.0","keywords":["a11yfy","accessibility","pdf","pdf/ua","remediation","wcag","eaa"],"license":"MIT","_id":"@a11yfy/sdk@0.1.0","maintainers":[{"name":"zoli211","email":"support@a11yfy.com"}],"homepage":"https://a11yfy.com","bugs":{"url":"https://github.com/a11yfy/sdk/issues"},"dist":{"shasum":"532aa68ab35aa50926c5f59f9fd558b1ab2501df","tarball":"https://registry.npmjs.org/@a11yfy/sdk/-/sdk-0.1.0.tgz","fileCount":9,"integrity":"sha512-NQnufvCD8o3sPu1DAPJ0p0AtudsgvehGIlG6GDFmcnCwUCMTRva9ilOeYzXy83/vYBlyYJKxLTmGx9/OpZ4GaQ==","signatures":[{"sig":"MEUCIQCIV2eYlijCukuSSzOTD5pzg0IRQWgZxgp0cKBahrspPQIgQLQIfcd7nInDmau/OvvO9NBZe8TWwGwSu1G7L63YnEM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a11yfy%2fsdk@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":718887},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"224fc9260076e81e2b8be4fded1ac12d2d34a27a","scripts":{"test":"node --import tsx --test tests/*.test.ts","build":"tsup","check":"tsc --noEmit","prepublishOnly":"npm run check && npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:539ba352-3a4e-4411-a803-16a6ab316940"}},"repository":{"url":"git+https://github.com/a11yfy/sdk.git","type":"git","directory":"sdks/typescript"},"_npmVersion":"12.0.1","description":"Official Node.js SDK for the a11yfy PDF accessibility remediation API","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","typescript":"^5.7.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1784157458001_0.8461658362333073","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@a11yfy/sdk","version":"0.2.0","keywords":["a11yfy","accessibility","pdf","pdf/ua","remediation","wcag","eaa"],"license":"MIT","_id":"@a11yfy/sdk@0.2.0","maintainers":[{"name":"zoli211","email":"support@a11yfy.com"}],"homepage":"https://a11yfy.com","bugs":{"url":"https://github.com/a11yfy/sdk/issues"},"dist":{"shasum":"633f6904399ff4b716ce771e5e7a61c0011c9569","tarball":"https://registry.npmjs.org/@a11yfy/sdk/-/sdk-0.2.0.tgz","fileCount":9,"integrity":"sha512-l/rBLftJHUw1L0+xvh80qpHTG6lDH7hUB8gKfBxImA967MDDmWA3bhSDvXcdVP5VYN6cdRM7pwzfMqkMs0tYrw==","signatures":[{"sig":"MEUCIQCIRBwKLOQUwKqbOB8vUO5zowlS2jlgAZqb7UueBAjdQgIgK0N/bfkv4fXXfgyxlPDzfGqCOnnSxQGSF3Uq4SdZcwo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a11yfy%2fsdk@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":720873},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"90370278525eee6e35cad091aff2d2595a02e11b","scripts":{"test":"node --import tsx --test tests/*.test.ts","build":"tsup","check":"tsc --noEmit","prepublishOnly":"npm run check && npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:539ba352-3a4e-4411-a803-16a6ab316940"}},"repository":{"url":"git+https://github.com/a11yfy/sdk.git","type":"git","directory":"sdks/typescript"},"_npmVersion":"12.0.1","description":"Official Node.js SDK for the a11yfy PDF accessibility remediation API","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","typescript":"^5.7.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.0_1785251069056_0.09819239452627881","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@a11yfy/sdk","version":"0.3.0","description":"Official Node.js SDK for the a11yfy PDF accessibility remediation API","license":"MIT","homepage":"https://a11yfy.com","repository":{"type":"git","url":"git+https://github.com/a11yfy/sdk.git","directory":"sdks/typescript"},"keywords":["a11yfy","accessibility","pdf","pdf/ua","remediation","wcag","eaa"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"engines":{"node":">=20"},"scripts":{"build":"tsup","check":"tsc --noEmit","test":"node --import tsx --test tests/*.test.ts","prepublishOnly":"npm run check && npm run build && npm test"},"devDependencies":{"@types/node":"^22.10.0","tsup":"^8.3.5","tsx":"^4.19.2","typescript":"^5.7.0"},"gitHead":"d23cd9fa48b8cd1937f10b004d03753806d0c0f4","_id":"@a11yfy/sdk@0.3.0","bugs":{"url":"https://github.com/a11yfy/sdk/issues"},"_nodeVersion":"22.23.1","_npmVersion":"12.0.1","dist":{"integrity":"sha512-JdTDqeuOzsc2BITSDb1tkT9ZPTYblRCiEzMJBKfz9zj24Om7NcA9XUfs+/7Ex/l3XxmXkW9YQqH9N5URVzeb3g==","shasum":"733845be6cdb11538a8c99a5c105d7447149c7a8","tarball":"https://registry.npmjs.org/@a11yfy/sdk/-/sdk-0.3.0.tgz","fileCount":9,"unpackedSize":730935,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a11yfy%2fsdk@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBwWJmeMoIROu93IimQVQkgVPttMFOzTceizIQxjNyqcAiEA4EwLtt2AQJHamdQe1ljrTDXsORjocrJlwaU2t0nYS3A="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:539ba352-3a4e-4411-a803-16a6ab316940"}},"directories":{},"maintainers":[{"name":"zoli211","email":"support@a11yfy.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.0_1785270815093_0.9255071253167872"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-31T23:44:41.167Z","modified":"2026-07-28T20:33:35.695Z","0.0.0-placeholder":"2026-05-31T23:44:41.413Z","0.1.0":"2026-07-15T23:17:38.153Z","0.2.0":"2026-07-28T15:04:29.239Z","0.3.0":"2026-07-28T20:33:35.314Z"},"bugs":{"url":"https://github.com/a11yfy/sdk/issues"},"license":"MIT","homepage":"https://a11yfy.com","keywords":["a11yfy","accessibility","pdf","pdf/ua","remediation","wcag","eaa"],"repository":{"type":"git","url":"git+https://github.com/a11yfy/sdk.git","directory":"sdks/typescript"},"description":"Official Node.js SDK for the a11yfy PDF accessibility remediation API","maintainers":[{"name":"zoli211","email":"support@a11yfy.com"}],"readme":"# a11yfy Node.js SDK\n\nOfficial Node.js SDK for the [a11yfy](https://a11yfy.com) PDF accessibility\nremediation API. Upload a PDF, get back a PDF/UA-compliant, screen-reader-friendly\ndocument — with a verifiable compliance certificate.\n\n## Installation\n\n```sh\nnpm install @a11yfy/sdk\n```\n\nRequires Node.js 20+. Server-side only (the API key is a secret).\n\n## Quickstart\n\n```ts\nimport { A11yfyClient } from \"@a11yfy/sdk\";\n\nconst client = new A11yfyClient({ token: process.env.A11YFY_API_KEY! });\n\nconst result = await client.remediate(\"document.pdf\"); // upload + poll + result\nconsole.log(result.output_url);                        // presigned URL of the remediated PDF\nif (result.certificate) {\n    console.log(result.certificate.download_url);      // compliance certificate PDF\n    console.log(result.certificate.verify_url);        // public verification page\n}\n```\n\n`remediate()` accepts a file path, `Buffer`, `File`/`Blob` or stream. It throws\n`JobFailedError` when the job fails and `RemediationTimeoutError` when the wait\nbudget (default 30 min) elapses — the job keeps running server-side.\n\n## Low-level API\n\n```ts\nconst job = await client.jobs.createJob({ file: new File([bytes], \"doc.pdf\") });\nconst status = await client.jobs.getJob({ id: job.job_id });   // pending|processing|done|failed|partial\nconst result = await client.jobs.getJobResult({ id: job.job_id });\n\nconst page = await client.jobs.listJobs({ limit: 50 }); // newest first, cursor pagination\nconst more = await client.jobs.listJobs({ cursor: page.next_cursor! });\n\nconst certs = await client.certificates.findCertificates({ job_id: job.job_id });\nconst bySha = await client.certificates.findCertificates({ output_sha256: \"<sha256>\" });\nconst pdf = await client.certificates.downloadCertificate({ certId: certs.certificates[0]!.certificate_id });\n\nconst balance = await client.billing.getBalance();\nconst usage = await client.billing.getUsage();\n```\n\n## Webhooks\n\nPass `webhookUrl` to get an HMAC-signed callback when the job finishes, then\nverify it with the Stripe-style helper:\n\n```ts\nimport { Webhooks, WebhookVerificationError } from \"@a11yfy/sdk\";\n\napp.post(\"/a11yfy-webhook\", (req, res) => {\n    let event;\n    try {\n        event = Webhooks.constructEvent(\n            req.rawBody,                                    // RAW string/Buffer!\n            req.headers[\"x-a11yfy-signature\"] as string,\n            process.env.A11YFY_WEBHOOK_SECRET!,\n        );\n    } catch (err) {\n        if (err instanceof WebhookVerificationError) return res.sendStatus(400);\n        throw err;\n    }\n    if (event.status === \"done\") download(event.output_url!);\n    res.sendStatus(200);\n});\n```\n\n## Configuration\n\n| Option | Default | Notes |\n|---|---|---|\n| `token` | `A11YFY_API_KEY` env var | `ak_live_...` / `ak_test_...` |\n| `baseUrl` | `https://a11yfy.com` | override for sandbox environments |\n| `remediate({ pollIntervalMs })` | 5000 | fixed-interval status polling |\n| `remediate({ timeoutMs })` | 1 800 000 | overall wait budget |\n\nDuplicate submissions are deduplicated automatically: `remediate()` sends the\nfile's SHA-256 as `Idempotency-Key`, so retrying the same file within 24h\nreturns the same job instead of billing twice.\n\n## Docs\n\nAPI reference: https://a11yfy.com/docs\n\n## License\n\nMIT\n","readmeFilename":"README.md"}