{"_id":"@codingducksrl/nestjs-stripe","_rev":"1-486dd57de67426be2ca33186d3019733","name":"@codingducksrl/nestjs-stripe","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"@codingducksrl/nestjs-stripe","version":"2.0.0","description":"Provides an injectable Stripe client to nestjs modules","repository":{"type":"git","url":"git+https://github.com/codingducksrl/nestjs-stripe.git"},"author":{"name":"Dylan Aspden","url":"https://github.com/dhaspden"},"contributors":[{"name":"Guglielmo Frati","url":"https://github.com/gsguglielmo"}],"license":"MIT","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"build":"tsc -p tsconfig.build.json","codecov":"codecov","format":"prettier --write '**/*.md' '**/*.json' '**/*.ts' '**/*.yml' .prettierrc","prebuild":"rimraf lib","prepublish:npm":"yarn build","publish:npm":"yarn publish --access public","test:cov":"jest --coverage","test:watch":"jest --watch","test":"jest"},"devDependencies":{"@nestjs/common":"10.2.7","@nestjs/core":"10.2.7","@nestjs/testing":"10.2.7","@types/jest":"29.5.6","@types/node":"20.8.8","codecov":"3.8.3","jest":"29.7.0","prettier":"3.0.3","reflect-metadata":"0.1.13","rimraf":"5.0.5","rxjs":"7.8.1","stripe":"14.1.0","ts-jest":"29.1.1","typescript":"5.2.2"},"peerDependencies":{"@nestjs/common":"^10.0.0","@nestjs/core":"10.2.7","reflect-metadata":"^0.1.12","rxjs":"^7.8.0","stripe":"^14.1.0"},"keywords":["nestjs","stripe","payment"],"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"coverageDirectory":"../coverage","testEnvironment":"node"},"_id":"@codingducksrl/nestjs-stripe@2.0.0","gitHead":"144e5ce5fc7cafe9915d73beb36f5311b9f5f97b","bugs":{"url":"https://github.com/codingducksrl/nestjs-stripe/issues"},"homepage":"https://github.com/codingducksrl/nestjs-stripe#readme","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-Eam1bCkdiO9AJxRaxexOoEavS3b1o15RSJz5EUKZWBuW7uWkmzyKng7MoqIwVWSFaxMR4N6f2cgUbVQIp7pOQA==","shasum":"a189214fe399eb92e80b499f03935d8b299184ba","tarball":"https://registry.npmjs.org/@codingducksrl/nestjs-stripe/-/nestjs-stripe-2.0.0.tgz","fileCount":51,"unpackedSize":25915,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzT8QDmoj2WKFMFG2TXKj90HXF0/D+64nIX8OIcr+hIwIhAINfg0rGHjqH2p2zycYpi2oK6tTTnF/Q5KoJPHgmv4u2"}]},"_npmUser":{"name":"gsguglielmo","email":"guglielmo.frati@codingduck.it"},"directories":{},"maintainers":[{"name":"gsguglielmo","email":"guglielmo.frati@codingduck.it"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-stripe_2.0.0_1698217738376_0.2589533546047682"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2023-10-25T07:08:58.287Z","2.0.0":"2023-10-25T07:08:58.644Z","modified":"2023-10-29T10:51:54.226Z"},"maintainers":[{"name":"gsguglielmo","email":"guglielmo.frati@codingduck.it"}],"description":"Provides an injectable Stripe client to nestjs modules","homepage":"https://github.com/codingducksrl/nestjs-stripe#readme","keywords":["nestjs","stripe","payment"],"repository":{"type":"git","url":"git+https://github.com/codingducksrl/nestjs-stripe.git"},"contributors":[{"name":"Guglielmo Frati","url":"https://github.com/gsguglielmo"}],"author":{"name":"Dylan Aspden","url":"https://github.com/dhaspden"},"bugs":{"url":"https://github.com/codingducksrl/nestjs-stripe/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <h3 align=\"center\">\n    nestjs-stripe2\n  </h3>\n\n  <p align=\"center\">\n    Injectable Stripe client for your nestjs projects\n  </p>\n</p>\n\n> Fork of the original [nestjs-stripe](https://github.com/dhaspden/nestjs-stripe) with support for nestjs v10\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [About](#about)\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Example](#example)\n- [Contributing](#contributing)\n- [License](#license)\n- [Acknowledgements](#acknowledgements)\n\n## About\n\n`nestjs-stripe` implements a module, `StripeModule`, which when imported into\nyour nestjs project provides a Stripe client to any class that injects it. This\nlets Stripe be worked into your dependency injection workflow without having to\ndo any extra work outside of the initial setup.\n\n## Installation\n\n```bash\nnpm install --save nestjs-stripe\n```\n\n## Getting Started\n\nThe simplest way to use `nestjs-stripe` is to use `StripeModule.forRoot`\n\n```typescript\nimport { Module } from '@nestjs-common';\nimport { StripeModule } from 'nestjs-stripe';\n\n@Module({\n  imports: [\n    StripeModule.forRoot({\n      apiKey: 'my_secret_key',\n      apiVersion: '2020-08-27',\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\nYou can then inject the Stripe client into any of your injectables by using a\ncustom decorator\n\n```typescript\nimport { Injectable } from '@nestjs/common';\nimport { InjectStripe } from 'nestjs-stripe';\nimport Stripe from 'stripe';\n\n@Injectable()\nexport class AppService {\n  public constructor(@InjectStripe() private readonly stripeClient: Stripe) {}\n}\n```\n\nAsynchronous setup is also supported\n\n```typescript\nimport { Module } from '@nestjs-common';\nimport { StripeModule } from 'nestjs-stripe';\n\n@Module({\n  imports: [\n    StripeModule.forRootAsync({\n      inject: [ConfigService],\n      useFactory: (configService: ConfigService) => ({\n        apiKey: configService.get('stripe_key'),\n        apiVersion: '2020-08-27',\n      }),\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\nRead up on the `stripe-node` caveats\n[here](https://github.com/stripe/stripe-node#usage-with-typescript). Due to the\nway `stripe-node` works you can only use the latest version of the Stripe API\nthat was published at the time the module version was published. If you wish to\nuse an older version of the Stripe API, follow the steps in the above link.\nBecause of this, the `apiVersion` field is now required along with the `apiKey`\nfield.\n\n## Example\n\nIn order to run the example run the following commands in your terminal. The\nexpected output of the example is to show that the Stripe client was\nsuccessfully injected into the `AppService`.\n\n```bash\ncd example\nyarn install\nyarn start\n```\n\n## Contributing\n\nI would greatly appreciate any contributions to make this project better. Please\nmake sure to follow the below guidelines before getting your hands dirty.\n\n1. Fork the repository\n2. Create your branch (`git checkout -b my-branch`)\n3. Commit any changes to your branch\n4. Push your changes to your remote branch\n5. Open a pull request\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Acknowledgements\n\n- [nestjs](https://nestjs.com)\n- [stripe-node](https://github.com/stripe/stripe-node)\n\nCopyright &copy; 2021 Dylan Aspden\n","readmeFilename":"README.md"}