{"_id":"@blockia-pay/checkout-sdk","_rev":"4-549df13ae2912e9b894f0a4390281d30","name":"@blockia-pay/checkout-sdk","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@blockia-pay/checkout-sdk","version":"0.1.0","_id":"@blockia-pay/checkout-sdk@0.1.0","maintainers":[{"name":"blockialabs","email":"kristijan.boshev@blockialabs.com"}],"dist":{"shasum":"6df7238b1505f597076e0713bd838bc34a7c90f8","tarball":"https://registry.npmjs.org/@blockia-pay/checkout-sdk/-/checkout-sdk-0.1.0.tgz","fileCount":33,"integrity":"sha512-76lIJ1R3o0B7n0bXzSVAO4htikHEcoz8I2S8lONIegdXXx7pvVCsC0+jRStGgGdpGYHW35SY8XKsU9smX7cKxg==","signatures":[{"sig":"MEUCIQChlwDemklrwc9qLYvhBJwfNjcbwf3vT8lIW9cFpzPyJgIgG6VOFGFm7CPYBnFxqbnMc7+5rveIxIPVRwWC3nj7FBE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64126},"main":"./dist/index.js","type":"module","_from":"file:blockia-pay-checkout-sdk-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"private":false,"scripts":{"dev":"tsc -p tsconfig.lib.json --watch","lint":"eslint . --ext .ts --max-warnings 0","build":"tsc -p tsconfig.lib.json","clean":"rm -rf dist","lint:fix":"eslint . --ext .ts --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"blockialabs","email":"kristijan.boshev@blockialabs.com"},"_resolved":"/private/var/folders/y3/bl9kqw_510v82kwzjm1sd74m0000gq/T/8e5c40df789c7d36e3d12629accc84f0/blockia-pay-checkout-sdk-0.1.0.tgz","_integrity":"sha512-76lIJ1R3o0B7n0bXzSVAO4htikHEcoz8I2S8lONIegdXXx7pvVCsC0+jRStGgGdpGYHW35SY8XKsU9smX7cKxg==","_npmVersion":"10.9.2","description":"Frontend SDK for merchants and developers to integrate **Blockia Pay Checkout** into their web applications. It enables easy creation of payment links and redirection to the Blockia checkout experience.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.22.4","axios":"^1.6.5","react":"^18.2.0","react-dom":"^18.2.0","@changesets/cli":"^2.29.7"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.5.3","@types/react":"^18.2.43","@types/react-dom":"^18.2.17"},"_npmOperationalInternal":{"tmp":"tmp/checkout-sdk_0.1.0_1762256668117_0.7922871846603148","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@blockia-pay/checkout-sdk","version":"0.1.1","_id":"@blockia-pay/checkout-sdk@0.1.1","maintainers":[{"name":"blockialabs","email":"kristijan.boshev@blockialabs.com"}],"dist":{"shasum":"4d11369175eb63308488c1057f9a6e79604c71ef","tarball":"https://registry.npmjs.org/@blockia-pay/checkout-sdk/-/checkout-sdk-0.1.1.tgz","fileCount":36,"integrity":"sha512-+rF0p5+L/YXP9sdhv1bbzlTjOY3pPvG9etl2Bi6nyf9SzQxazzdmOagW2nxoY2T3IRYUVCHJZDsDKbo3W1sW+A==","signatures":[{"sig":"MEUCIQDkxiZGa9MI5V3GceUrLzlmZ6/Kgr5bxGbpeeGemedsbwIgS81wPJd5eMLcofuR9v/8KVn8b0C8AJB7iMxaOYcQwBc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66951},"main":"./dist/index.js","type":"module","_from":"file:blockia-pay-checkout-sdk-0.1.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"private":false,"scripts":{"dev":"tsc -p tsconfig.lib.json --watch","lint":"eslint . --ext .ts --max-warnings 0","build":"tsc -p tsconfig.lib.json","clean":"rm -rf dist","lint:fix":"eslint . --ext .ts --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"blockialabs","email":"kristijan.boshev@blockialabs.com"},"_resolved":"/private/var/folders/y3/bl9kqw_510v82kwzjm1sd74m0000gq/T/60dcc410b24c45c7ac9bfafa99ef8cb9/blockia-pay-checkout-sdk-0.1.1.tgz","_integrity":"sha512-+rF0p5+L/YXP9sdhv1bbzlTjOY3pPvG9etl2Bi6nyf9SzQxazzdmOagW2nxoY2T3IRYUVCHJZDsDKbo3W1sW+A==","_npmVersion":"10.9.2","description":"Frontend SDK for merchants and developers to integrate **Blockia Pay Checkout** into their web applications. It enables easy creation of payment links and redirection to the Blockia checkout experience.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.22.4","axios":"^1.6.5","react":"^18.2.0","react-dom":"^18.2.0","@changesets/cli":"^2.29.7"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.5.3","@types/react":"^18.2.43","@types/react-dom":"^18.2.17"},"_npmOperationalInternal":{"tmp":"tmp/checkout-sdk_0.1.1_1762349897218_0.23287012031897403","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@blockia-pay/checkout-sdk","version":"0.1.2","_id":"@blockia-pay/checkout-sdk@0.1.2","maintainers":[{"name":"blockialabs","email":"kristijan.boshev@blockialabs.com"}],"dist":{"shasum":"dd239aa5c4ebbac80190b166c1959f33e017d382","tarball":"https://registry.npmjs.org/@blockia-pay/checkout-sdk/-/checkout-sdk-0.1.2.tgz","fileCount":37,"integrity":"sha512-0/egZnXHDWbUoj5TR5EQggWKFn8YR5d8G3N4pqstVo9+IgrkAoxL0dP6YaWWEyYyrSfFunSSKCsmaR1ckozH1g==","signatures":[{"sig":"MEUCIQCPiWasdOsB3C2NfurFwAtMclOaEEa3pAhllXBbuDDGGQIgB3Jrr4Z3511D9U0XHYCgCTZIMA2IXx+yDOgI5gjB9fM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70498},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"d2391ae1c93203dfc2d5649997aba39da3fb36fd","private":false,"scripts":{"dev":"tsc -p tsconfig.lib.json --watch","lint":"eslint . --ext .ts --max-warnings 0","build":"tsc -p tsconfig.lib.json","clean":"rm -rf dist","lint:fix":"eslint . --ext .ts --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"blockialabs","email":"kristijan.boshev@blockialabs.com"},"_npmVersion":"10.9.2","description":"Frontend SDK for merchants and developers to integrate **Blockia Pay Checkout** into their web applications. It enables easy creation of payment records and redirection to the Blockia checkout experience.","directories":{},"_nodeVersion":"22.15.1","dependencies":{"zod":"^3.22.4","axios":"^1.6.5","react":"^18.2.0","react-dom":"^18.2.0","@changesets/cli":"^2.29.7"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.5.3","@types/react":"^18.2.43","@types/react-dom":"^18.2.17"},"_npmOperationalInternal":{"tmp":"tmp/checkout-sdk_0.1.2_1763999578828_0.03778906558600825","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@blockia-pay/checkout-sdk","version":"0.1.3","private":false,"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.lib.json","dev":"tsc -p tsconfig.lib.json --watch","clean":"rm -rf dist","typecheck":"tsc --noEmit","lint":"eslint . --ext .ts --max-warnings 0","lint:fix":"eslint . --ext .ts --fix"},"dependencies":{"axios":"^1.6.5","react":"^18.2.0","react-dom":"^18.2.0","@changesets/cli":"^2.29.7","zod":"^3.22.4"},"devDependencies":{"typescript":"^5.5.3","@types/react":"^18.2.43","@types/react-dom":"^18.2.17"},"_id":"@blockia-pay/checkout-sdk@0.1.3","gitHead":"d45e8c0affa53bd15be955f824649bcee7ce8583","description":"Frontend SDK for merchants and developers to integrate **Blockia Pay Checkout** into their web applications. It enables easy creation of payment records and redirection to the Blockia checkout experience.","_nodeVersion":"22.15.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-MvC6FsdeR2KfNhEH7ji+lKj8gIdQ0q7beeMpFvWns2AT06gE5u4BvngfhxKwMF6Y0FfyoC2sWfdolbNY5CR/KA==","shasum":"3ff64fade14d01ab231bacbab23d3bd9a34ca2bf","tarball":"https://registry.npmjs.org/@blockia-pay/checkout-sdk/-/checkout-sdk-0.1.3.tgz","fileCount":36,"unpackedSize":70458,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCLY9tumhZo5eiv81NkehxP3XJMyMSC9ptkrZILKQptGAIhAKOfIMaDzIq/H/MJ5H6tkvtRDqz/i502MF8mUdg0nyZs"}]},"_npmUser":{"name":"blockialabs","email":"kristijan.boshev@blockialabs.com"},"directories":{},"maintainers":[{"name":"blockialabs","email":"kristijan.boshev@blockialabs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/checkout-sdk_0.1.3_1764000047908_0.07884526898456357"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-04T11:44:28.032Z","modified":"2025-11-24T16:00:48.324Z","0.1.0":"2025-11-04T11:44:28.300Z","0.1.1":"2025-11-05T13:38:17.418Z","0.1.2":"2025-11-24T15:52:59.018Z","0.1.3":"2025-11-24T16:00:48.094Z"},"description":"Frontend SDK for merchants and developers to integrate **Blockia Pay Checkout** into their web applications. It enables easy creation of payment records and redirection to the Blockia checkout experience.","maintainers":[{"name":"blockialabs","email":"kristijan.boshev@blockialabs.com"}],"readme":"# @blockia-pay/checkout-sdk\n\nFrontend SDK for merchants and developers to integrate **Blockia Pay Checkout**\ninto their web applications. It enables easy creation of payment records and\nredirection to the Blockia checkout experience.\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install @blockia-pay/checkout-sdk\n# or\nyarn add @blockia-pay/checkout-sdk\n# or\npnpm add @blockia-pay/checkout-sdk\n```\n\n---\n\n## ⚡ Quick Start\n\n```typescript\nimport { BlockiaCheckout } from '@blockia-pay/checkout-sdk';\n\nconst checkout = new BlockiaCheckout({\n  secretKey: 'sk_live_...',\n  baseApiUrl: 'http://localhost:3000',\n});\n\n// On button click\nasync function handleCheckout() {\n  const payment = await checkout.createPayment({\n    amount: 49.99,\n    description: 'Premium Plan - Monthly',\n  });\n\n  checkout.redirectToCheckout(payment.url);\n}\n```\n\n---\n\n## 🧩 React Checkout Button\n\nIf you're using React, the SDK also provides a **`CheckoutButton`** component\nfor a creation of a payment link and redirect to it, you can also now add\noptional parameters like cancel url or success url so you will be redirected to\nanother page after successful or unsuccessful payment.\n\n### Example\n\n```tsx\nimport React from 'react';\nimport { CheckoutButton } from '@blockia-pay/checkout-sdk/react/CheckoutButton';\n\nexport default function App() {\n  return (\n    <CheckoutButton\n      secretKey=\"sk_live_...\"\n      baseApiUrl=\"https://api.blockia.io\"\n      amount={49.99}\n      description=\"Premium Plan - Monthly\"\n      label=\"Pay with Blockia\"\n      onSuccess={() => alert('Payment successful!')}\n      onFailure={() => alert('Payment failed!')}\n      style={{\n        backgroundColor: '#6C63FF',\n        color: '#fff',\n        borderRadius: '8px',\n        padding: '0.75rem 1.5rem',\n      }}\n    />\n  );\n}\n```\n\n---\n\n## 🧬 API Reference\n\n### **Constructor**\n\n```\nnew BlockiaCheckout(config: BlockiaCheckoutConfig)\n```\n\nInitializes the SDK with your API secret key and (optionally) base URL.\n\n---\n\n### **Methods**\n\n#### `createPayment(paymentData)`\n\nCreates a new payment record with the specified amount and description.\n\n#### `redirectToCheckout(url)`\n\nRedirects the browser to the Blockia Checkout page.\n\n---\n\n## ⚠️ Error Handling\n\nThe SDK throws typed errors extending `BlockiaError`:\n\n- **`ValidationError`** – Missing or invalid configuration\n- **`LinkError`** – Failed to create or fetch a payment record\n\n---\n\n## 🧪 License\n\nMIT © Blockia Labs\n","readmeFilename":"README.md"}