Skip to content

Commit

Permalink
update documentation to use appInfo (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianaranda committed Feb 26, 2022
1 parent 2a1a35b commit 2d75754
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions README.md
Expand Up @@ -367,13 +367,27 @@ expect(event.id).to.equal(payload.id);

### Writing a Plugin

If you're writing a plugin that uses the library, we'd appreciate it if you identified using `stripe.setAppInfo()`:
If you're writing a plugin that uses the library, we'd appreciate it if you instantiated your stripe client with `appInfo`, eg;

```js
stripe.setAppInfo({
name: 'MyAwesomePlugin',
version: '1.2.34', // Optional
url: 'https://myawesomeplugin.info', // Optional
const stripe = require('stripe')('sk_test_...', {
appInfo: {
name: 'MyAwesomePlugin',
version: '1.2.34', // Optional
url: 'https://myawesomeplugin.info', // Optional
}
});
```

Or using ES modules or TypeScript:

```js
const stripe = new Stripe(apiKey, {
appInfo: {
name: 'MyAwesomePlugin',
version: '1.2.34', // Optional
url: 'https://myawesomeplugin.info', // Optional
}
});
```

Expand Down

0 comments on commit 2d75754

Please sign in to comment.