> For the complete documentation index, see [llms.txt](https://docs.sensepass.com/sensepay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sensepass.com/sensepay/transaction-api/sdk-and-iframes/javascript-ui-sdk/api/migration-to-sensepass-elements.md).

# Migration to SensePass Elements

### Installing a fresh SDK

Follow the [documentation](https://docs.sensepass.com/sensepay/transaction-api/sdk-and-iframes/javascript-ui-sdk/api#tab-sensepass-elements-beta) for installing SensePass element SDK:

{% embed url="<https://docs.sensepass.com/sensepay/transaction-api/sdk-and-iframes/javascript-ui-sdk/api#tab-sensepass-elements-beta>" %}

***

### Upgrading from SDK Version 1.0.9/1.1.0 (or below)

1. Update the SensePass SDK `javascript` link to version 1.1.1 (or above).\
   For example: if your’e using `https://js.sensepass.com/scripts/sensepass-front-end@1.0.9.sdk.js` -> you should update it to `https://js.sensepass.com/scripts/sensepass-front-end@1.1.1.sdk.js` .
2. Update your [configuration](https://docs.sensepass.com/sensepay/transaction-api/sdk-and-iframes/javascript-ui-sdk/api#step-1-configuration) `object` with a `key` string `payButtonId` and a `value` string of your choosing, for example:

   <pre class="language-javascript" data-line-numbers><code class="lang-javascript">const paymentElementId = "my-payment-button";
   const spSdkConfig = {
      mode: "sandbox", // "sandbox" | "production"
      debug: true, // optional for logs
      visualizer: true, // optional visual logs, requires HTML with id="sensepass-front-end-visualizer"
      clientId: "aee8d2cdc1cb...", // Client ID
      methodType: "manual_capture", // type for the transaction, defaults to "manual_capture", enum: "manual_capture" | "tokenize" | "authorize"
      payButtonId: paymentElementId // id for the payment-button (element) the customer will click to start the payment process
   };
   </code></pre>
3. Update your `HTML` element that invokes the `pay` method from the SDK with an `id` attribute and `value` from step #2, e.g. `id="my-payment-button"`.

***

### Onboarding your domain for Apple Pay

1. Send SensePass the domain(s) you’ll use Apple Pay on.\
   For example:\
   \- [www.my-store.com](http://www.my-store.com)\
   \- [my-subdomain.my-store.com](http://my-subdomain.my-store.com)\
   \- [my-other-store.com](http://my-other-store.com)
2. Open public access from your website(s) to a file from the base path of your url.\
   For example:\
   \- <https://www.my-store.com/**.well-known/apple-developer-merchantid-domain-association.txt**.\\>
   \* This will let Apple validate your domain is associated with SensePass’s Apple account.
3. Receive from SensePass the `apple-developer-merchantid-domain-association.txt` file(s) and store them in your website(s).\
   \* SensePass will send you the file(s) in a `.zip` named to match it’s domain.\
   **Make sure to store the .zip content in its correct website.**
4. Inform SensePass all `apple-developer-merchantid-domain-association.txt` file(s) are stored and publicly accessible.
5. Receive confirmation from SensePass that your domain(s) are Apple Pay ready.

{% hint style="danger" %}
**Its very important to store the files & inform SensePass ASAP because the file(s) can expire.**
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sensepass.com/sensepay/transaction-api/sdk-and-iframes/javascript-ui-sdk/api/migration-to-sensepass-elements.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
