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

# Embed in Web App

Use our web SDK to embed the buyer's payment method form into your web application. First, add our web SDK to your document's `<head>` tag:

<CodeGroup>
  ```html Sandbox theme={null}
  <script src="https://checkout.sandbox.manifestfinancial.com/checkout.js"></script>
  ```

  ```html Production theme={null}
  <script src="https://checkout.manifestfinancial.com/checkout.js"></script>
  ```
</CodeGroup>

## Embed

Now you can initialize the SDK and embed the buyer's payment method form into an `iframe` on your page:

```javascript theme={null}
const checkout = new MCheckout();
const config = {
    iframeId,
    embedUrl,
    parentDomain,
    onResize,
    onPaymentMethodUpdated,
    options
};
checkout.embed(config);
```

<ParamField path="iframeId" type="string" required={true}>
  The ID of the `iframe` element to embed the buyer's payment method form into.
</ParamField>

<ParamField path="embedUrl" type="string" required={true}>
  The `payment_method_embed_url` to embed.
</ParamField>

<ParamField path="parentDomain" type="string" required={true}>
  The domain of the parent page. This page must be served over HTTPS. Please note that for Apple Pay to work, the parent domain must be added to your merchant account by Manifest. Please contact [developer@manifestfinancial.com](mailto:developer@manifestfinancial.com) to begin verifying your domain.
</ParamField>

<ParamField path="onResize" type="function" required={false}>
  The height of the content has changed. The new values are passed in as an object with `width` and `height` properties. Depending on your design, you may need to resize the embedded view to match the new height.
</ParamField>

<ParamField path="onPaymentMethodUpdated" type="function" required={false}>
  The buyer has successfully updated their payment method; you can navigate to the next step of your process.
</ParamField>

<ParamField path="options" type="object" required={false}>
  An object of [customization options](/platform/payment-methods/customization) to customize the buyer's payment method form.
</ParamField>

### Example

```javascript theme={null}
const config = {
    iframeId: "checkout-iframe",
    embedUrl: payment_method_embed_url,
    parentDomain: "my-app.com",
    onResize: ({ width, height }) => {
        // resize your iframe, etc here
    },
    onPaymentMethodUpdated: () => {
        // update your UI here
    },
    options: {
        font: "Poppins",
        buttonBorderRadius: "22px",
        // other customization options
    }
}

checkout.embed(config);
```

***

## Check Digital Wallet Support (optional)

There is an optional function that allows you to check if the buyer's device supports digital wallets — useful if you'd like to show a different UI based on support.

```javascript theme={null}
checkout.checkDigitalWalletSupport().then((results) => {
    const { applePay, googlePay, enabled } = results;
    // Update your UI here
}
```

It returns a promise that resolves to an object with the following properties:

<ParamField path="applePay" type="boolean">
  Whether the buyer's device supports *Apple Pay*.
</ParamField>

<ParamField path="googlePay" type="boolean">
  Whether the buyer's device supports *Google Pay*.
</ParamField>

<ParamField path="enabled" type="boolean">
  Whether the buyer's device supports any digital wallets.
</ParamField>
