# JavaScript Methods
source: https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/index.md

Tip: You can disregard any additional fields identified in Requests or Responses or API specs that are not defined as part of documentation.

Once you have configured the Mastercard SDK following the steps in the [Integrate with Click to Pay](https://developer.mastercard.com/mastercard-checkout-solutions/tutorial/integrate_apis/step2/index.md) tutorial, you can start using the SDK methods.

## Overview of SDK Methods {#overview-of-sdk-methods}

The SDK provides the following methods:

|                                                                           Method                                                                           |                                                                                                                                                                                                                                                                                              Description                                                                                                                                                                                                                                                                                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [init()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/init/index.md)                                         | This method initializes the SDK with common state. It must be called before any other method. Without this, nothing else will work. It is asynchronous and has no response.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [isRecognized()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/is-recognized/index.md)                        | This method determines if the user is recognized (e.g., by detecting the presence of a local cookie in the browser environment) and, if the user is recognized, obtains a [federated ID token (JWT)](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/is-recognized/index.md#id-token). The integrator can then provide this [ID token](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/is-recognized/index.md#id-token) in the `getSrcProfile` method call (to this or other SDKs / other Click to Pay Systems). |
| [getSrcProfile()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/get-src-profile/index.md)                     | This method takes a list of federated ID tokens and returns Click to Pay Profile data (masked consumer data and matching masked card data). This can be used to show the consumer the cards they have associated with Click to Pay so that they can select the card they wish to use for the transaction. The browser may also attach an HTTP-only secure cookie to the corresponding HTTP request to the Mastercard System, which can also drive recognition towards a Click to Pay Profile.                                                                                                          |
| [identityLookup()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/identity-lookup/index.md)                    | Checks whether a specified Consumer Identity (email address or mobile phone number) is known to the Mastercard System.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [authenticate()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/authenticate/index.md)                         | Invokes the authentication UI to perform identification and verification (ID\&V) for a given authentication method, such as OTP or passkey. Note: We recommend using *authenticate()* , which encapsulates the functionalities of *initiateIdentityValidation()* and *completeIdentityValidation()* methods.                                                                                                                                                                                                                                                                                           |
| [initiateIdentityValidation()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/initiate-id-validation/index.md) | This method initiates Consumer Identifier validation via an appropriate mechanism, for example, sending an OTP to the Consumer's email address or mobile phone number.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [completeIdentityValidation()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/complete-id-validation/index.md) | This method completes the validation of a Consumer Identifier, by evaluating supplied validation data, for example, an OTP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [enrollCard()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/enroll-card/index.md)                            | This method enrolls a new PAN to the Mastercard System during checkout. The PAN may be enrolled to an existing / identified Click to Pay Profile, or to a newly-created Click to Pay Profile, or may not be added to an Click to Pay Profile at all, in the case of guest checkout.                                                                                                                                                                                                                                                                                                                    |
| [checkout()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/checkout-method/index.md)                          | This method sends the specified card details to the DCF (via the Mastercard System). The DCF will then be able to launch a pop-up window to perform checkout. The Mastercard System will return firstly a promise and then when checkout has occurred, communicate a payload ID back to the front end. This should be sent to your integrator back end (using your own process) so that the back end can complete the transaction by requesting the payment payload ([POST /checkout](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/api-reference/apis/index.md)).      |
| [unbindAppInstance()](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/unbind-app/index.md)                      | This method disassociates the Consumer application / Consumer Device from the Consumer's Click to Pay Profile.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

All methods exposed by the library return a promise---successful calls resolve the promise with a response, failed calls reject the promise with the list of errors.

Example:

```JavaScript
window.object.getCards()
  .then((response) => {
      console.log('CARDS', response.cards')
      })
      .catch((errors) => {
          console.log('ERRORS', errors')
      })
```

