{"_id":"@asentum/pay","name":"@asentum/pay","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@asentum/pay","version":"0.1.0","description":"TypeScript SDK for Asentum Pay. Accept on-chain payments with a few lines of code.","license":"Apache-2.0","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"keywords":["asentum","payments","stripe","checkout","subscriptions","crypto"],"repository":{"type":"git","url":"git+https://github.com/asentum-network/pay-sdk.git"},"homepage":"https://pay.asentum.com","bugs":{"url":"https://github.com/asentum-network/pay-sdk/issues"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"devDependencies":{"@types/node":"^20.16.0","tsup":"^8.0.0","typescript":"^5.5.0","vitest":"^1.0.0"},"_id":"@asentum/pay@0.1.0","gitHead":"ac6e5bc0e67ae9347942d5bfb5aa90c40a04933d","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-j1feSmvmfFKlwUL5H+a9ZMGgjd7tlFZFpcdTRqDTFSgtgxidTR3rPGGgTXa4T0SsZoIgdzd564H0JQieJiwnSA==","shasum":"b12fe5de252de523e9de5bddcd232dfa9e598cc3","tarball":"https://registry.npmjs.org/@asentum/pay/-/pay-0.1.0.tgz","fileCount":13,"unpackedSize":62572,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAIod/6wEGspNlwKMq6Vd1QPtC2lvEwkJ3QFfrFGb6e7AiAr6rZem9lqSHwmghL85AWEGbXT9KxLTc3LAtwaelGi/A=="}]},"_npmUser":{"name":"milkie_eth","email":"its.quo.eth@gmail.com"},"directories":{},"maintainers":[{"name":"milkie_eth","email":"its.quo.eth@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pay_0.1.0_1779001658085_0.9962317186219749"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-17T07:07:38.007Z","0.1.0":"2026-05-17T07:07:38.265Z","modified":"2026-05-17T07:07:38.466Z"},"maintainers":[{"name":"milkie_eth","email":"its.quo.eth@gmail.com"}],"description":"TypeScript SDK for Asentum Pay. Accept on-chain payments with a few lines of code.","homepage":"https://pay.asentum.com","keywords":["asentum","payments","stripe","checkout","subscriptions","crypto"],"repository":{"type":"git","url":"git+https://github.com/asentum-network/pay-sdk.git"},"bugs":{"url":"https://github.com/asentum-network/pay-sdk/issues"},"license":"Apache-2.0","readme":"# @asentum/pay\n\nTypeScript SDK for [Asentum Pay](https://pay.asentum.com). Accept on-chain payments with a few lines of code. Works in Node, browsers, Bun, Deno, Cloudflare Workers.\n\n## Install\n\n```\nnpm install @asentum/pay\n```\n\n## Quick start\n\n```ts\nimport { Asentum } from '@asentum/pay';\n\nconst pay = new Asentum('sk_test_...');\n\n// One-shot charge\nconst charge = await pay.charges.create({\n  amount: '50.00',\n  currency: 'aUSD',\n  description: 'Order #1234',\n});\n\n// Hosted checkout\nconst session = await pay.checkout.sessions.create({\n  lineItems: [{ name: 'Pro plan', amount: '20.00', currency: 'aUSD' }],\n  successUrl: 'https://myshop.com/done',\n  cancelUrl: 'https://myshop.com/cancel',\n});\n// Redirect the user to session.url\n```\n\n## Resources\n\n| Resource | Methods |\n| - | - |\n| `pay.charges` | `create`, `retrieve`, `list` |\n| `pay.customers` | `create`, `retrieve`, `update`, `list` |\n| `pay.checkout.sessions` | `create`, `retrieve`, `list` |\n| `pay.webhooks` | `create`, `retrieve`, `delete`, `list`, `verify` |\n\nSubscriptions (`pay.subscriptions`) ship in v0.2 alongside the protocol cron layer (ARC-21).\n\n## Verifying webhooks\n\n```ts\nimport { Asentum } from '@asentum/pay';\n\nconst pay = new Asentum(process.env.ASENTUM_API_KEY);\n\n// In your webhook handler:\nconst event = pay.webhooks.verify({\n  payload: rawBody,\n  signatureHeader: req.headers['x-asentum-signature'],\n  secret: process.env.ASENTUM_WEBHOOK_SECRET,\n});\n\nswitch (event.type) {\n  case 'charge.succeeded': /* ... */ break;\n  case 'checkout.session.completed': /* ... */ break;\n}\n```\n\n## Errors\n\nAll API failures throw a `PayApiError` with `status`, `code`, and `requestId` fields.\n\n```ts\nimport { PayApiError } from '@asentum/pay';\n\ntry {\n  await pay.charges.create({ amount: 'nope', currency: 'aUSD' });\n} catch (err) {\n  if (err instanceof PayApiError) {\n    console.error(`${err.status} ${err.code}: ${err.message}`);\n  }\n}\n```\n\n## Status\n\nThis is a v0 release covering one-shot payments. Subscriptions, customer portal, and the broader product surface land in v0.2.\n\nFull docs at [pay.asentum.com](https://pay.asentum.com).\n","readmeFilename":"README.md","_rev":"1-440951b5d592aeaf0f0266ed351e50e6"}