{"id":13598885,"url":"https://github.com/dhaspden/nestjs-stripe","last_synced_at":"2025-12-30T00:15:29.756Z","repository":{"id":34997090,"uuid":"194968206","full_name":"dhaspden/nestjs-stripe","owner":"dhaspden","description":"Provides an injectable Stripe client to nestjs modules","archived":false,"fork":false,"pushed_at":"2023-04-15T21:46:27.000Z","size":1067,"stargazers_count":159,"open_issues_count":18,"forks_count":39,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-08T23:16:40.110Z","etag":null,"topics":["dependency-injection","nestjs","nodejs","payment","payment-processing","stripe","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhaspden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-07-03T02:50:13.000Z","updated_at":"2025-02-21T07:29:13.000Z","dependencies_parsed_at":"2024-01-12T19:48:32.774Z","dependency_job_id":"a538f6a5-ef6c-4997-b1fe-24acdf3cfb48","html_url":"https://github.com/dhaspden/nestjs-stripe","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhaspden%2Fnestjs-stripe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhaspden%2Fnestjs-stripe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhaspden%2Fnestjs-stripe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhaspden%2Fnestjs-stripe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhaspden","download_url":"https://codeload.github.com/dhaspden/nestjs-stripe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199136,"owners_count":21063641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency-injection","nestjs","nodejs","payment","payment-processing","stripe","typescript"],"created_at":"2024-08-01T17:00:57.766Z","updated_at":"2025-10-30T20:47:00.935Z","avatar_url":"https://github.com/dhaspden.png","language":"TypeScript","funding_links":[],"categories":["资源","Integrations","TypeScript"],"sub_categories":["集成"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003e\n    nestjs-stripe\n  \u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Injectable Stripe client for your nestjs projects\n  \u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://circleci.com/gh/dhaspden/nestjs-stripe.svg?style=svg\"\u003e\n    \u003ca href=\"https://codecov.io/gh/dhaspden/nestjs-stripe\"\u003e\n      \u003cimg src=\"https://codecov.io/gh/dhaspden/nestjs-stripe/branch/master/graph/badge.svg\" /\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\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) =\u003e ({\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 \u0026copy; 2021 Dylan Aspden\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhaspden%2Fnestjs-stripe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhaspden%2Fnestjs-stripe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhaspden%2Fnestjs-stripe/lists"}