Please see the Single page application scenario to understand the scenarios in which MSAL.js can be used and the basics required for integration of MSAL.js.
Prerequisite: App registration
Before using MSAL JS, register your application in Azure portal to get your client_id. As part of the registration, you will also need to add the Web platform, enable the Implicit flow, and add the redirectURI to your application. You can follow the steps to register a SPA on the app registration steps.
Please refer Installation.
Initialization of MSAL
Calling Login and acquire token APIS
For all the public APIs available in MSAL.js, please refer the MSAL.js reference