# Framer integration

Integrating your claimr widget into Framer allows you to seamlessly display your interactive content within your Framer designs. This guide will walk you through the process, which involves setting up a frame and configuring a Code Override to embed the widget.

### Create a frame in Framer

In Framer, everything begins with a frame. This frame will serve as the container for your claimr widget.

* Create a new **Frame** in your Framer project.
* You can style this frame as needed, or leave it with default styling.

### Access Code overrides

To embed the claimr widget, you will use Framer's Code Overrides feature, which allows you to extend component functionality with custom code.

* Select your newly created Frame.
* In the right-hand properties panel, scroll down and open the **Code Overrides** tab at the bottom.
* Click the **+** button to add a new file. If no override file exists, you will be prompted to create one.

### Create the Override File

This file will contain the custom code necessary to initialize and load your claimr widget.

<figure><img src="https://2111509621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtEHhi1fQEriwxTxRejw%2Fuploads%2FI2j8v4CEVec51mpsJOSZ%2FScreenshot%202025-06-16%20at%2020.12.26.png?alt=media&#x26;token=0d2475c5-e26b-4f8f-87f2-8ebbdef5c53a" alt="" width="229"><figcaption></figcaption></figure>

* Name your file (e.g., `claimrIntegration.tsx`) and click **Create**.
* In the newly opened code editor, <mark style="color:yellow;">paste the override code provided</mark>. <mark style="color:yellow;">NEED THIS CODE</mark>\
  This code sets up the mechanism to load the claimr widget.

### Edit the Override Code

You will need to modify the override file to include specific `data-` attributes that define your claimr widget's behavior and link it to your campaign.

<figure><img src="https://2111509621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtEHhi1fQEriwxTxRejw%2Fuploads%2F9UU9xXFewp58VSOJAPyR%2FScreenshot%202025-06-16%20at%2020.13.27.png?alt=media&#x26;token=1c3ca314-97cb-497e-bfef-1b1cb8b617f1" alt=""><figcaption></figcaption></figure>

* Within the override file, find or create a function (e.g., `claimrIntegration`).
* Pass all the necessary `data-` attributes required for your claimr widget to this function. These attributes are crucial for the widget to correctly identify your campaign and organization:
  * `data-id`: The ID of your widget instance.
  * `data-organization`: Your organization's name.
  * `data-company`: Your company's name.
  * `data-container-id`: This attribute should match the ID of the Framer frame you created in Step 1, which will act as the widget's container.

**Example of an override function**

```typescript
import { Override } from "framer"

const SCRIPT_ID = "CLAIMR_SCRIPT_ID"
const CLAIMR_CONTAINER_ID = "CLAIMR_CONTAINER_ID"

export function claimrIntegration(
    Component: ComponentType<any>
): Override {
    return {
        onMount: (props: any) => () => {
            const handle_script_creation = useCallback(() => {
                const script = document.createElement("script")
                script.setAttribute("id", "claimer-script")
                script.setAttribute("data-organization", "claimr")
                script.setAttribute("data-campaign", "dapp")
                script.setAttribute("data-container", CLAIMR_CONTAINER_ID)
                script.setAttribute("data-add-ons", "sup,wcc,pvm")
                script.setAttribute("src", "https://widgets.claimr.io/claimr.min.js")
                document.body.appendChild(script)
            }, [])

            useEffect(() => {
                handle_script_creation()
            }, [])
        },
    }
}

```

### Link override to your frame

After editing the override code, you need to apply it to your specific Framer frame.

<figure><img src="https://2111509621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBtEHhi1fQEriwxTxRejw%2Fuploads%2FKb8GXcGNmb7Rfw1AUTz9%2FScreenshot%202025-06-16%20at%2020.08.58.png?alt=media&#x26;token=f3ebaf06-2fff-4576-a002-5f03d0fa88f4" alt="" width="216"><figcaption></figcaption></figure>

* In the **Layers** tab, select the Frame you created before.
* In the **Code Overrides** section of the right-hand properties panel, select your newly created file.
* From the function dropdown, choose the specific function you defined.

### Finalize and publish your project

Once the override is linked, save your changes and publish the project to see the integrated widget.

* Framer typically autosaves your changes. Ensure all modifications are saved.
* Click **Publish** to deploy your project.
* Verify on the published page that the claimr widget is successfully integrated and functioning correctly within your Framer design.
