From d78d6789d0738693f9b9c3244b2dfde05caa41f5 Mon Sep 17 00:00:00 2001 From: Talita Yada Date: Mon, 13 Feb 2023 11:49:09 -0300 Subject: [PATCH] update readme --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c154e2..b7c60fa 100644 --- a/README.md +++ b/README.md @@ -49,18 +49,26 @@ It is a **clientside SDK** whose main objective is to **facilitate the integrati
## 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 ``` +or + +```npm +npm install @mercadopago/sdk-js; +``` +
## Initializing To start the SDK, you need to assign your `public_key` along with some `options`. +If you are using `html` reference: + ### Example: ```javascript @@ -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', +}) +``` +
## Checkout API