Skip to content

Commit

Permalink
Merge pull request #404 from iHani/patch-1
Browse files Browse the repository at this point in the history
other: Fix import FormData example
  • Loading branch information
olexandr-mazepa authored Jul 18, 2024
2 parents 66e21dc + 5dbbe6c commit 90086ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ Once the package is installed, you can import the library using `import` or `req
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'key-yourkeyhere'});
```
```js
import * as FormData from 'form-data';
import FormData from 'form-data';
import Mailgun from 'mailgun.js';
const mailgun = new Mailgun(FormData);
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'key-yourkeyhere'});
```
### Using Subaccounts
Primary accounts can make API calls on behalf of their subaccounts. [API documentation](https://documentation.mailgun.com/en/latest/subaccounts.html#subaccounts)
```js
import * as FormData from 'form-data';
import FormData from 'form-data';
import Mailgun from 'mailgun.js';
const mailgun = new Mailgun(FormData);
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'key-yourkeyhere'});
Expand All @@ -75,7 +75,7 @@ Primary accounts can make API calls on behalf of their subaccounts. [API documen
By leveraging client configuration options, users can effortlessly establish proxy connections that align with their network requirements.
Ex:
```js
import * as FormData from 'form-data';
import FormData from 'form-data';
import Mailgun from 'mailgun.js';
const mailgun = new Mailgun(FormData);

Expand Down

0 comments on commit 90086ca

Please sign in to comment.