{"_id":"@balancer-team/nextform","_rev":"6-8bb408103e66bdee3a35cc841d3d0193","name":"@balancer-team/nextform","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@balancer-team/nextform","version":"0.0.1","author":{"name":"Alan Hettinger"},"license":"MIT","_id":"@balancer-team/nextform@0.0.1","maintainers":[{"name":"alanhett","email":"ahettinger@gmail.com"}],"dist":{"shasum":"87bd3ccfdac1ca46a2322dfad2c95c81fb661334","tarball":"https://registry.npmjs.org/@balancer-team/nextform/-/nextform-0.0.1.tgz","fileCount":13,"integrity":"sha512-cqiQQQSwt+zoC01ZV0v/TKyBPX0/y1Wt2pD2SdWEMPLuYAvyZ5veIZj5jc9ao+ztVpqZA1lTyo1QIrfMkYmnEw==","signatures":[{"sig":"MEUCIQC7DrWMQO+glKcHkOxTTnHPvqnOPiHDLB78+iBNJTeY5QIgXqA4yr+ci+NeZzMAakIa4kzMlJhlPRUlHEVbFvXIGkY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17635},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"b1f6653f28b072535eb9a4ef3b1df50a381c8168","scripts":{"test":"node --require ts-node/register --test test/*.test.ts","build":"tsc"},"_npmUser":{"name":"alanhett","email":"ahettinger@gmail.com"},"_npmVersion":"10.8.3","description":"Nextform JavaScript Client and Utilities","directories":{},"_nodeVersion":"20.16.0","dependencies":{"zod":"^3.23.8"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.5","ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/nextform_0.0.1_1727441077271_0.48575283985808415","host":"s3://npm-registry-packages"},"deprecated":"This package has moved to @nextform/nextform. Please update your dependencies."},"0.0.2":{"name":"@balancer-team/nextform","version":"0.0.2","keywords":["tax form","W-9","W-8BEN","W-8BEN-E","irs","kyc"],"author":{"name":"Alan Hettinger"},"license":"MIT","_id":"@balancer-team/nextform@0.0.2","maintainers":[{"name":"alanhett","email":"ahettinger@gmail.com"}],"homepage":"https://nextform.app","bugs":{"url":"https://github.com/balancer-team/nextform-js/issues"},"dist":{"shasum":"ab1707437939db10a3fd4d0b41b4834a7ef2531a","tarball":"https://registry.npmjs.org/@balancer-team/nextform/-/nextform-0.0.2.tgz","fileCount":13,"integrity":"sha512-IBpuBLH/xdt2qAPXjlYXHrGG1P+KBAf/aVD9+ERgBrbzXYJzqiox9ueS8NFPh92kyCi03BoTInnwjlqPo2vvCg==","signatures":[{"sig":"MEUCIASA2HSNwJL5zIdzxhX+UR6GMAS+wpe60ZRCrGe9+CF9AiEAqQ+yqkFgx7DbSXsToNsnbkXaAmu2rXrQp42Ze8+FE1Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17824},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"58b33d4cc5dea4e699072a6eaf0b161e42d6dbb2","scripts":{"test":"node --require ts-node/register --test test/*.test.ts","build":"tsc"},"_npmUser":{"name":"alanhett","email":"ahettinger@gmail.com"},"repository":{"url":"git+https://github.com/balancer-team/nextform-js.git","type":"git"},"_npmVersion":"10.8.3","description":"Nextform JavaScript Client and Utilities","directories":{},"_nodeVersion":"20.16.0","dependencies":{"zod":"^3.23.8"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.5","ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/nextform_0.0.2_1727441223879_0.024343249538180567","host":"s3://npm-registry-packages"},"deprecated":"This package has moved to @nextform/nextform. Please update your dependencies."},"0.0.3":{"name":"@balancer-team/nextform","version":"0.0.3","keywords":["tax form","W-9","W-8BEN","W-8BEN-E","irs","kyc"],"author":{"name":"Alan Hettinger"},"license":"MIT","_id":"@balancer-team/nextform@0.0.3","maintainers":[{"name":"alanhett","email":"ahettinger@gmail.com"}],"homepage":"https://nextform.app","bugs":{"url":"https://github.com/balancer-team/nextform-js/issues"},"dist":{"shasum":"4e999f8accbebfa8b2e4c00a6795d27673c051b6","tarball":"https://registry.npmjs.org/@balancer-team/nextform/-/nextform-0.0.3.tgz","fileCount":13,"integrity":"sha512-JZzn9P/cRVsXyg/zxvdj5aHr/MWs1nGJSt77uvss69EwZymEmDREH+mci07L6p9hSdwOkafVLBmPQWjdOX/jcw==","signatures":[{"sig":"MEUCIQDNR2WR6Cz9++1FLkVfx2QAL7LFMAh03N/FGKe1XDbaGQIgASe3rtoxlnzL0kFGQ37a/lMML2lYKMOwRf+LUEAW/GA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19200},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"ba4a3a4c28e0fa4770d3577df6d2c7e1b0512c2a","scripts":{"test":"node --require ts-node/register --test test/*.test.ts","build":"tsc"},"_npmUser":{"name":"alanhett","email":"ahettinger@gmail.com"},"repository":{"url":"git+https://github.com/balancer-team/nextform-js.git","type":"git"},"_npmVersion":"10.8.3","description":"Nextform JavaScript Client and Utilities","directories":{},"_nodeVersion":"20.16.0","dependencies":{"zod":"^3.23.8"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.5","ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/nextform_0.0.3_1747250595292_0.4864539708491389","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package has moved to @nextform/nextform. Please update your dependencies."},"0.0.4":{"name":"@balancer-team/nextform","version":"0.0.4","keywords":["tax form","W-9","W-8BEN","W-8BEN-E","irs","kyc"],"author":{"name":"Alan Hettinger"},"license":"MIT","_id":"@balancer-team/nextform@0.0.4","maintainers":[{"name":"alanhett","email":"ahettinger@gmail.com"}],"homepage":"https://nextform.app","bugs":{"url":"https://github.com/balancer-team/nextform-js/issues"},"dist":{"shasum":"15d642a3f77e8b1681dd87af5befa4a2563aba97","tarball":"https://registry.npmjs.org/@balancer-team/nextform/-/nextform-0.0.4.tgz","fileCount":13,"integrity":"sha512-5dV2hp/U8nMGCeM7AjatoYnw43dv5wLYur4ciZFKpng7X+RMVZEKa9xKG/HVpGAOAVxXfUBTtbl4UcAWAEVU2w==","signatures":[{"sig":"MEYCIQDkU3UqOrhjRO6EoxYOPPDyyPuNL/ZRaeZ5Ajv+yZ+sEQIhAIp/O+DjlGDjGdmw6BoWJ4y7Iho3qlPTSkgtG0shmdgF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19216},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"f5f994d449b7b3c1c63e8869918b9bf6485d540c","scripts":{"test":"node --require ts-node/register --test test/*.test.ts","build":"tsc"},"_npmUser":{"name":"alanhett","email":"ahettinger@gmail.com"},"repository":{"url":"git+https://github.com/balancer-team/nextform-js.git","type":"git"},"_npmVersion":"10.8.3","description":"Nextform JavaScript Client and Utilities","directories":{},"_nodeVersion":"20.16.0","dependencies":{"zod":"^3.23.8"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.5","ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/nextform_0.0.4_1747250978200_0.9142822314281185","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package has moved to @nextform/nextform. Please update your dependencies."},"0.0.5":{"name":"@balancer-team/nextform","version":"0.0.5","keywords":["tax form","W-9","W-8BEN","W-8BEN-E","irs","kyc"],"author":{"name":"Alan Hettinger"},"license":"MIT","_id":"@balancer-team/nextform@0.0.5","maintainers":[{"name":"alanhett","email":"ahettinger@gmail.com"}],"homepage":"https://nextform.app","bugs":{"url":"https://github.com/balancer-team/nextform-js/issues"},"dist":{"shasum":"b1698b63acbe4fefa8e98957d3b8db1f15000b5c","tarball":"https://registry.npmjs.org/@balancer-team/nextform/-/nextform-0.0.5.tgz","fileCount":13,"integrity":"sha512-Cmbh3jbW2iZVggzgwOUANyGxInvqGnlOJhlnAIFkC84XlEj9VOtZgrttAuc5kzWcSQOcrJWOI8V46U9kNEJKTA==","signatures":[{"sig":"MEUCIDzt4roKuB0rJLJgfxelVbD0W+0LQqwUNxTPwhnVSiHGAiEAm08rPfbA0WMVoUVaMjlpsmqPtJMWv4xkr1xPWR96rZA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20454},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"fb399cb17b3a39ea95b5254974a33900fa786b9a","scripts":{"test":"node --require ts-node/register --test test/*.test.ts","build":"tsc"},"_npmUser":{"name":"alanhett","email":"ahettinger@gmail.com"},"repository":{"url":"git+https://github.com/balancer-team/nextform-js.git","type":"git"},"_npmVersion":"10.8.3","description":"Nextform JavaScript Client and Utilities","directories":{},"_nodeVersion":"20.16.0","dependencies":{"zod":"^3.23.8"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.5","ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/nextform_0.0.5_1747251463611_0.5774237739085011","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package has moved to @nextform/nextform. Please update your dependencies."}},"time":{"created":"2024-09-27T12:44:37.142Z","modified":"2026-04-30T19:52:06.296Z","0.0.1":"2024-09-27T12:44:37.479Z","0.0.2":"2024-09-27T12:47:04.070Z","0.0.3":"2025-05-14T19:23:15.466Z","0.0.4":"2025-05-14T19:29:38.372Z","0.0.5":"2025-05-14T19:37:43.776Z"},"bugs":{"url":"https://github.com/balancer-team/nextform-js/issues"},"author":{"name":"Alan Hettinger"},"license":"MIT","homepage":"https://nextform.app","keywords":["tax form","W-9","W-8BEN","W-8BEN-E","irs","kyc"],"repository":{"url":"git+https://github.com/balancer-team/nextform-js.git","type":"git"},"description":"Nextform JavaScript Client and Utilities","maintainers":[{"name":"alanhett","email":"ahettinger@gmail.com"}],"readme":"# JavaScript Library for W-9 and W-8BEN\n\nThis JavaScript library helps you collect, generate, and keep track of commonly requested IRS forms such as W-9, W-8BEN, and W-8BEN-E using the Nextform API.\n\n### Install\n\n```bash\nnpm i @balancer-team/nextform\n```\n\n### Usage\n\nProvide your API key and optional webhook secret to the `Nextform` constructor. You can obtain a free API key by signing up at [nextform.app](https://nextform.app/).\n\n```ts\nimport { Nextform } from '@balancer-team/nextform'\n\nconst nextform = new Nextform({\n  apiKey: 'YOUR_API_KEY',\n  webhookSecret: 'YOUR_WEBHOOK_SECRET',\n})\n```\n\nSet up a session by calling `createSession` with the desired form type. The form type can be one of the following:\n\n- `w9` - Form W-9 (Request for Taxpayer Identification Number and Certification)\n- `w8ben` - Form W-8BEN (Certificate of Foreign Status of Beneficial Owner)\n- `w8bene` - Form W-8BEN-E (Certificate of Status of Beneficial Owner for Entities)\n\n```ts\nconst session = await nextform.createSession({\n  formType: 'w9', // or 'w8ben' or 'w8bene'\n})\n\n// Output:\n//\n// {\n//   id: 'oymuG8Hz2NJJVrEvYNM5e',\n//   formType: 'w9Mar2024',\n//   reference: '',\n//   status: 'open',\n//   url: 'https://nextform.app/form/w9Mar2024/oymuG8Hz2NJJVrEvYNM5e',\n//   ...\n// }\n```\n\nThe [session object](https://nextform.app/docs/create-session) contains a URL that you can use to open the form in a browser. Redirect your users to this URL to collect the form data.\n\n### Receive and Verify Webhooks\n\nTo receive webhooks, set up a webhook endpoint in your application. The endpoint should verify the webhook signature using the `verifyWebhook` method. This ensures that the webhook is from Nextform and not from an unauthorized source. The below example uses the `express` library to set up a simple webhook endpoint. Modify the code below to use your preferred web framework.\n\n```ts\nrouter.post('/webhook', async (req, res) => {\n  // Obtain the signature and body from the request\n  const signature = req.get('Nextform-Signature')\n  const body = JSON.stringify(req.body) // Assumes you are using express.json() middleware\n\n  // Verify the webhook signature\n  const isVerified = nextform.verifyWebhook({ signature: signature, body: body }) // true or false\n  if (!isVerified) return res.status(401).send('Invalid signature.')\n\n  // Add your code to handle the data from the webhook\n  const data = req.body\n  // ...\n})\n```\n","readmeFilename":"README.md"}