{"_id":"@autospendai/checkout-sdk","name":"@autospendai/checkout-sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@autospendai/checkout-sdk","version":"1.0.0","description":"Autospend Checkout library","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"tsc --build --clean","build":"tsc --b && rollup -c rollup.config.public.js && rollup -c rollup.config.module.js","lint":"eslint '*/**/*.{js,ts}' --fix","start":"tsc -b --watch --incremental --verbose","static":"node server.js","dev":"node watch-and-build.js"},"author":{"name":"Autospend"},"license":"MIT","devDependencies":{"@rollup/plugin-replace":"^2.4.2","@types/node":"^15.12.2","@typescript-eslint/eslint-plugin":"^4.4.0","@typescript-eslint/parser":"^4.4.0","dotenv":"^10.0.0","eslint":"^7.10.0","eslint-config-prettier":"^6.12.0","eslint-plugin-prettier":"^3.1.4","prettier":"^2.1.2","rollup":"^2.3.4","rollup-plugin-terser":"^7.0.2","ts-loader":"^8.0.4","typescript":"^4.0.3"},"keywords":["Autospend","Autospend-checkout-sdk","Autospend-checkout-npm","Autospend-checkout-widget","Autospend-checkout-widget-js","Autospend-ai-js","Autospend-ai-npm","npm-Autospend","npm-Autospend-ai","Autospend-widget","Autospend-widget-js"],"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts}":["eslint --fix"]},"dependencies":{"express":"^4.17.1"},"repository":{"type":"git","url":"git+https://temitopeadesoji@github.com/Autospend/autospend-widget.git"},"bugs":{"url":"https://github.com/Autospend/autospend-widget/issues"},"homepage":"https://github.com/Autospend/autospend-widget#readme","_id":"@autospendai/checkout-sdk@1.0.0","gitHead":"4d9b45529f8e60d5001185142c2ad4347809e97b","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-5gzH9vd0M7ssw9aqTgBqp3RwPkHFQ3PbaF3y7YGvf2/ne5kXj3ZznXayPQlEEurWOqF3Kc/Dg25xcFohTD3etA==","shasum":"7ef62253abd393c9663fc3fe9673b0d5230d40af","tarball":"https://registry.npmjs.org/@autospendai/checkout-sdk/-/checkout-sdk-1.0.0.tgz","fileCount":23,"unpackedSize":70014,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGmQInmwUI9GrWJYSxsbVwJlaTCfzW7X+ONK6Huqm1pZAiBlL/yneEKBtmZosc4hReIjAF+POyNHbL2MQA0Yq/ZAhw=="}]},"_npmUser":{"name":"dotunajl","email":"dotun@collect.africa","actor":{"name":"dotunajl","email":"dotun@collect.africa","type":"user"}},"directories":{},"maintainers":[{"name":"dotunajl","email":"dotun@collect.africa"},{"name":"ojes","email":"abraham@autospend.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/checkout-sdk_1.0.0_1750666879993_0.2477082849996488"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-23T08:21:19.913Z","1.0.0":"2025-06-23T08:21:20.231Z","modified":"2025-06-23T08:21:20.479Z"},"maintainers":[{"name":"dotunajl","email":"dotun@collect.africa"},{"name":"ojes","email":"abraham@autospend.ai"}],"description":"Autospend Checkout library","homepage":"https://github.com/Autospend/autospend-widget#readme","keywords":["Autospend","Autospend-checkout-sdk","Autospend-checkout-npm","Autospend-checkout-widget","Autospend-checkout-widget-js","Autospend-ai-js","Autospend-ai-npm","npm-Autospend","npm-Autospend-ai","Autospend-widget","Autospend-widget-js"],"repository":{"type":"git","url":"git+https://temitopeadesoji@github.com/Autospend/autospend-widget.git"},"author":{"name":"Autospend"},"bugs":{"url":"https://github.com/Autospend/autospend-widget/issues"},"license":"MIT","readme":"# Autospend Widget - JavaScript SDK\n\nJS library for implementing the Autospend widget - Autospend widget is a safe and secure web drop-in module and this library provides a front-end web with ability to make payment for each bank that Autospend [supports].\n\n## Try the demo\n\nCheckout the [widget flow](https://autospend.ai/) to view how the Autospend Widget works. _Click \"See How it Works\"_\n\n## Before getting started\n\n- Retrieve your Client Public API Keys.\n- Create a sandbox customer, so you can get connecting immediately.\n\n## Installing\n\nUsing npm:\n\n```bash\n$ npm install @autospendai/checkout-sdk\n```\n\nUsing yarn:\n\n```bash\n$ yarn add @autospendai/checkout-sdk\n```\n\n## Usage\n\nFor JS frameworks import it and use\n\n```js\nimport AutospendCheckoutService from '@autospendai/checkout-sdk';\n```\n\nFor others, just use\n\n```js\nconst checkout = new AutospendCheckoutService({\n  email: 'peterparker@gmail.com',\n  firstName: 'Peter',\n  lastName: 'Parker',\n  reference: 'XXXXX-XXXXX',\n  amount: 1000000, // in Kobo\n  currency: 'NGN', // NGN\n  itemImage: '', // URL for item image\n  paymentLinkCode: '', // Payment link code\n  invoiceCode: '', // Invoice code\n  planCode: '', // Plan code\n  publicKey: 'pk_sandbox_XXXXXXXXXX', // Your public key\n  onSuccess(e) {\n    console.log('payment successful.', e);\n  },\n  onClose(e) {\n    console.log('closed the widget.', e);\n  },\n});\n\ncheckout.setup();\ncheckout.open();\n```\n\n## AutospendWidget Options\n\n| Name              | Type          | Required | Default Value    | Description                                  |\n| ----------------- | ------------- | -------- | ---------------- | -------------------------------------------- |\n| `email`           | `String`      | true     |                  | Email address.                               |\n| `firstName`       | `String`      | true     |                  | First name.                                  |\n| `lastName`        | `String`      | false    |                  | Last name.                                   |\n| `reference`       | `String`      | true     |                  | Unique transaction reference                 |\n| `amount`          | `Number`      | true     |                  | Amount to charge.                            |\n| `currency`        | `String`      | false    | NGN              | Processing currency                          |\n| `itemImage`       | `String(URL)` | false    |                  | URL for item image                           |\n| `publicKey`       | `String`      | true     |                  | The Autospend public api key.                |\n| `paymentLinkCode` | `String`      | false    |                  | The payment link code.                       |\n| `invoiceCode`     | `String`      | false    |                  | The invoice code.                            |\n| `planCode`        | `String`      | false    |                  | The plan code.                               |\n| `logo`            | `String(URL)` | false    | Autospend's Logo |                                              |\n| `callbackUrl`     | `String(URL)` | false    |                  |                                              |\n| `onSuccess`       | `Function`    | false    |                  | Action to perform after widget is successful |\n| `onClose`         | `Function`    | false    |                  | Action to perform if widget is closed        |\n| `onError`         | `Function`    | false    |                  | Action to perform on widget Error            |\n| `beforeClose`     | `Function`    | false    |                  | Action to perform before widget close        |\n\n## Other information\n\nFor enquires and questions, contact\n\n- [@DotunAj](https://github.com/DotunAj)\n\n- [@sazzy-josh](https://github.com/sazzy-josh)\n","readmeFilename":"README.md","_rev":"1-10137cb6829c3b2cf9e26d2876f81738"}