Skip to content

Commit 2d75754

Browse files
author
Christian Aranda
authored
update documentation to use appInfo (#1311)
1 parent 2a1a35b commit 2d75754

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,27 @@ expect(event.id).to.equal(payload.id);
367367

368368
### Writing a Plugin
369369

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

372372
```js
373-
stripe.setAppInfo({
374-
name: 'MyAwesomePlugin',
375-
version: '1.2.34', // Optional
376-
url: 'https://myawesomeplugin.info', // Optional
373+
const stripe = require('stripe')('sk_test_...', {
374+
appInfo: {
375+
name: 'MyAwesomePlugin',
376+
version: '1.2.34', // Optional
377+
url: 'https://myawesomeplugin.info', // Optional
378+
}
379+
});
380+
```
381+
382+
Or using ES modules or TypeScript:
383+
384+
```js
385+
const stripe = new Stripe(apiKey, {
386+
appInfo: {
387+
name: 'MyAwesomePlugin',
388+
version: '1.2.34', // Optional
389+
url: 'https://myawesomeplugin.info', // Optional
390+
}
377391
});
378392
```
379393

0 commit comments

Comments
 (0)