SDK JS - ES Module
To install the frontend SDK, include MercadoPago.js in your application's HTML or install the package on npm according to the code below.
<body>
<script src="https://sdk.mercadopago.com/js/v2"></script>
</body>
npm install @mercadopago/sdk-js
Then, add the Public key of the account being integrated so that it can be identified when connecting to Mercado Pago. Learn more about Public key in Credentials.
<script>
const mp = new MercadoPago("YOUR_PUBLIC_KEY");
</script>
import { loadMercadoPago } from "@mercadopago/sdk-js";
await loadMercadoPago();
const mp = new window.MercadoPago("YOUR_PUBLIC_KEY");