## Installation
#### Option 1 (recommended): NPM Package
The SDK is provided as NPM package. Please add it to your project by:
``bash`
npm i @paypay/mini-app-js-sdk -SOR
yarn add @paypay/mini-app-js-sdk
To use the Javascript API, please add the following import:
`js`
import pp from "@paypay/mini-app-js-sdk";
#### Option 2: HTML
The SDK can also be used by simply including it in your HTML code:
`HTML`
The Javascript automatically detects if you are running your website inside PayPay's Mini App environment or inside a browser.
Please initialize the SDK with the following command:
`js`
pp.init({
clientId: 'YOUR_CLIENT_ID',
env: 'sandbox', //default: 'production'
success() {
console.log('init successful')
},
fail() {
console.log('init failed')
},
})
After initializing, the Mini App JS SDK is ready to use.
You can verify it by getting a success callback with a sample call, i.e.:`js``
pp.getUAID({
success: (res) => {
console.log(JSON.stringify(res))
},
fail: (error) => {
console.log(JSON.stringify(error))
},
complete: () => {}
})