> Add Plandalf to a Framer site in Site Settings, then open a checkout from an Embed component.

Source: https://plandalf.com/docs/websites/framer

Websites and builders

# Framer

Add the Plandalf script to your Framer site settings once, then drop an Embed component wherever you want a checkout button, an inline checkout or a deadline timer.

**Before you start**

Framer runs custom code only on a paid site plan, and only on the published site, not in the canvas or preview.

## Add the script

These are the install steps for Framer. Copy the script from your checkout's **Share** screen (pick **HTML**) so it holds your own address.

1.  ### Install the SDK
    
    Site Settings → Custom Code → End of <body>. Paste the script tag.
    
    ```html
    <script async src="https://YOUR-ORG.plandalf.dev/js/plandalf-sdk.js"></script>
    ```
    
2.  ### Add the trigger button
    
    Insert an Embed component where you want the element. Paste the HTML.
    
    ```html
    <button data-plandalf-present="YOUR-CHECKOUT">Buy Now</button>
    ```
    
3.  ### Make the first open instant (optional)
    
    Paste this under the SDK script tag on the pages that hold the trigger. It fetches the checkout UI (about 1.2 MB) in the background while the page sits idle, so the click only pays for creating the session. Leave it off pages with no checkout: visitors download it whether or not they buy. In a React app, call sdk.preload('checkout') from the ready callback in an effect instead.
    
    ```html
    <script>
      // Optional: fetch the checkout UI while the page is idle, so the first click opens at once.
      window.plandalf = window.plandalf || function () { (window.plandalf.q = window.plandalf.q || []).push(arguments); };
      plandalf('ready', (sdk) => sdk.preload('checkout'));
    </script>
    ```
    

In Framer, open **Site Settings → General**, scroll to **Custom Code** and paste the script into **End of <body> tag**. Then click **Publish**.

## Open a checkout from a button

Insert an **Embed** component where the button should go, set it to **HTML** and paste:

```html
<button data-plandalf-present="YOUR-CHECKOUT">Buy Now</button>
```

Style the button with inline CSS or a class in your custom code. Framer adds HTML embeds to the published page after it loads, which is fine: the script watches for elements added later. More options are in [Buy buttons](https://plandalf.com/docs/checkouts/buy-buttons).

## Show a checkout on the page

Insert an **Embed** component, set it to **HTML** and paste:

```html
<div data-plandalf-mount="YOUR-CHECKOUT" style="min-height: 480px"></div>
```

Size the Embed component to fit the checkout, or set its height to fit content.

## Show a deadline timer

In an **Embed** component, paste an empty element with your deadline timer's slug. The script draws the live countdown inside it. To charge the deadline timer's current price, add `data-plandalf-apply-promo` with the same slug to your buy button.

```html
<div data-plandalf-promo="YOUR-PROMO"></div>
<button data-plandalf-present="YOUR-CHECKOUT" data-plandalf-apply-promo="YOUR-PROMO">Buy Now</button>
```

See [Countdowns](https://plandalf.com/docs/promos/countdowns).

## Check it's working

1.  ### Open the published site
    
    Use a private window. In the browser console, type `plandalf`: you should see a function. `undefined` means the script isn't on the page.
    
2.  ### Click your button
    
    The checkout opens over the page.
    
3.  ### Make a test purchase
    
    Add your Framer address, such as `your-site.framer.website`, in Plandalf under **Settings → Advanced → Test domains**. Checkouts there use Stripe test cards while your custom domain stays live. See [Test mode](https://plandalf.com/docs/get-started/test-mode).
    

## If it isn't working

-   Publish again after you change custom code, and check the plan includes custom code.
-   The canvas and preview never run the script. Test the published URL.
-   Add `data-debug="true"` to the script tag and the console logs each step the script takes.

See [Troubleshooting](https://plandalf.com/docs/help/troubleshooting).

Something wrong or missing? Email [hello@plandalf.com](mailto:hello@plandalf.com).
