> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ionicfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK upgrades

> What changed in @ionicfi/sdk 0.4, @ionicfi/js 0.2, and @ionicfi/react 0.2, and what to update in your integration.

The Blocks and Connect guides use these versions:

| Package          | Version | What's new                                                                                      |
| ---------------- | ------- | ----------------------------------------------------------------------------------------------- |
| `@ionicfi/sdk`   | 0.4.1   | Connect `account` request option; `client_secret` on PaymentIntents and SetupIntents for Blocks |
| `@ionicfi/js`    | 0.2.1   | `loadIonic` and Ionic Blocks, with the `account` option for platforms                           |
| `@ionicfi/react` | 0.2.1   | Built on `@ionicfi/js` 0.2.1; `CheckoutEmbed` is unchanged                                      |

```bash theme={null}
npm install @ionicfi/sdk@^0.4.1
npm install @ionicfi/js@^0.2.1      # payment pages and embedded checkout
npm install @ionicfi/react@^0.2.1   # embedded checkout in React
```

These packages are pre-1.0, so a minor version can include breaking changes.
Review the changes below and test in test mode before deploying.

## @ionicfi/sdk 0.4.1

### Select a connected merchant per request

Pass `{ account }` as the second argument to a supported method. The SDK sends
`Ionic-Account` for that request.

```ts theme={null}
const setupIntent = await ionic.setupIntents.create(
  { currency: "usd", customer: "cus_BBBBBBBBBBBBBB", "Idempotency-Key": "save:123" },
  { account: "mer_BBBBBBBBBBBBBB" },
);
```

PaymentIntents, SetupIntents, and customers accept the option. Requests that
manage payment domains or webhook endpoints act on the platform itself and take
no `account`. See [How Connect works](/guides/connect-overview).

### Manage API keys in the dashboard

The `apiKeys` resource is removed. Create, list, and rotate merchant keys in
**Developers → API keys** and platform keys in **Connect → API keys**. Remove
server jobs that called `ionic.apiKeys`. [Authentication](/api-reference/authentication)
covers key permissions and storage.

### Reference payments by Ionic IDs

`Charge` and `Refund` responses contain Ionic fields only. The `gateway` and
`gateway_transaction_id` fields are no longer returned on `Charge`, and
`gateway_transaction_id` is no longer returned on `Refund`. Use the Ionic Charge
and Refund IDs for retrieval, refunds, and support requests.

## @ionicfi/js 0.2.1

### Ionic Blocks

`loadIonic(publishableKey)` returns a client with `blocks`, `confirmPayment`,
`confirmSetup`, `retrievePaymentIntent`, and `retrieveSetupIntent`. Platforms
pass `{ account: connectedMerchantId }` as the second argument. Follow
[Build a payment page](/guides/payment-fields) or
[Accept payments for connected merchants](/guides/connect-blocks).

`mountPaymentFields` remains available for tokenization-only integrations. See
[Advanced card fields](/guides/payment-fields-advanced).

### Embedded checkout

`loadIonicCheckout` and `IonicCheckout.mountSession` are unchanged. Apple Pay on
embedded checkout continues to render in your page, and its
[domain registration](/guides/apple-pay) is unchanged.

## @ionicfi/react 0.2.1

`CheckoutEmbed` and its props are unchanged. The package depends on
`@ionicfi/js` 0.2.1, so update both together. For a custom payment form in a
React app, mount a Block from `@ionicfi/js` in an effect and destroy it on unmount.

## Before you deploy

* Run the payment, save, and uncertain-result paths in test mode with
  [test cards](/guides/test-cards).
* Confirm your [Content Security Policy](/guides/payment-fields#content-security-policy)
  allows the Ionic script, API, and frame hosts.
* Register live webhook endpoints and verify a signature before launch. See
  [Going live](/guides/going-live).
