Skip to content

Commit

Permalink
Merge pull request #129 from mercadopago/feature/readme
Browse files Browse the repository at this point in the history
[SDK] Update readme
  • Loading branch information
AdaltonLeite authored Feb 13, 2023
2 parents 160e2a1 + d78d678 commit b0e0109
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,26 @@ It is a **clientside SDK** whose main objective is to **facilitate the integrati
<br />

## Installation
To install the SDK, you must include script in your application's HTML:
To install the SDK, you must include script in your application's HTML or install a package on `npm`


```html
<script src="https://sdk.mercadopago.com/js/v2"></script>
```

or

```npm
npm install @mercadopago/sdk-js;
```

<br />

## Initializing
To start the SDK, you need to assign your `public_key` along with some `options`.

If you are using `html` reference:

### Example:

```javascript
Expand All @@ -69,6 +77,19 @@ const mp = new MercadoPago('YOUR_PUBLIC_KEY', {
})
```

If you are using `npm` package:

### Example:

```javascript
import { loadMercadoPago } from '@mercadopago/sdk-js'

await loadMercadoPago();
const mp = new window.MercadoPago('YOUR_PUBLIC_KEY', {
locale: 'en-US',
})
```

<br/>

## Checkout API
Expand Down

0 comments on commit b0e0109

Please sign in to comment.