# Initialize the JavaScript Library
source: https://developer.mastercard.com/mastercard-checkout-solutions/tutorial/integrate_apis/step3/index.md

## Step 3. Initialize the JavaScript Library {#step-3-initialize-the-javascript-library}

* When the consumer clicks View Basket/Shopping Cart to initiate checkout, call the [init()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/init/index.md) method to initialize the JavaScript library.

* Calling [init()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/init/index.md) also creates a `window.click2pay` object which exposes the remaining methods you will require to complete a checkout.

* Consecutively, call **[isRecognized()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/is-recognized/index.md)** before any other actions to ensure a returning user has been recognized correctly.

