The document will guide you with the step by step integration with the npm package.
Step 1 : Install the SDK from NPM
Command : npm install phonepesdk-web
The latest code can be found in the repository as https://www.npmjs.com/package/phonepesdk-web
Step 2 : Check CDN and JSSDK should have HTTPS URLs
Step 3 : Add the SDK within your code. This can be done in 2 ways :
a.) Include in index.html of the app :
Copy phonepesdk.js file from node_modules/phonepesdk-web folder and upload it on CDN. Include this CDN link in your index.html file.
To initiate SDK, you can do :
b.) Import in JS file of the app.
After doing npm install phonepesdk-web, just import and use as illustrated in the snippet below