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

# How to implement an interface in your integration

## Finding the interface to implement

Unfortunately, interfaces aren't yet listed on our website, so you must find them in the Botpress GitHub repository. To find the interface you want to implement, follow these steps:

**1. Open the interfaces directory**

Navigate to the [`interfaces` directory](https://github.com/botpress/botpress/tree/master/interfaces) of the [botpress/botpress](https://github.com/botpress/botpress) repository.

**2. Find the interface**

Find the interface you want to implement and open its directory.

**3. Find the name and version**

Open the `interface.definition.ts` file to find the interface `name` and `version`.

## Adding the interface as a dependency

Once you have the interface name and version, you can add it as a dependency to your integration:

**1. Open the package.json file**

Open your integration's `package.json` file.

**2. Add the dependencies section**

If there is no `bpDependencies` section in your integration's `package.json` file, create one:

```json theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
{
  "bpDependencies": {}
}
```

**3. Add the interface as a dependency**

In the `bpDependencies` section, add the interface name and version as a dependency. For example, with an interface named `creatable` and version `0.0.1`, you would add the following:

```json theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
{
  "bpDependencies": {
    "creatable": "interface:creatable@0.0.1"
  }
}
```

> [!WARNING]
>
> It's very important to follow this syntax: \\
>
> `"<interface-name>": "interface:<interface-name>@<version>"`.

**4. Save the package.json file**

Save the `package.json` file.

**5. Install the interface**

Now that you have added the interface as a dependency, you can run the [`bp add`](https://botpress.com/docs/integrations/sdk/cli-reference#add) command to install it. This command will:

* Download the interface from Botpress.
* Install it in a directory named `bp_modules` in your integration's root directory.

## Adding a helper build script

To keep your integration up to date, we recommend adding a helper build script to your integration:

**1. Open the package.json file**

Open your integration's `package.json` file.

**2. Add the build script**

In the `scripts` section, add the following script:

```json theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
{
  "scripts": {
    "build": "bp add -y && bp build"
  }
}
```

> [!NOTE]
>
> If the `build` script already exists in your `package.json` file, please replace it.

**3. Save the package.json file**

Save the `package.json` file.

Now, whenever you run `npm run build`, it will automatically install the interface and build your integration. This is useful for ensuring that your integration is always up to date with the latest version of the interface.

## Adding the interface to your integration definition file

Now that the interface is installed, you must add it your integration definition file in order to implement it.

**1. Open the integration.definition.ts file**

Open your integration's `integration.definition.ts` file.

**2. Import the interface**

At the top of the file, import the interface. For example, with an interface named `creatable`, you would add the following import statement:

```typescript theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import creatable from './bp_modules/creatable'
```

**3. Extend your definition**

Use the `.extend()` function at the end of your `new IntegrationDefinition()` statement. For example, with an interface named `creatable`, you would add the following:

```typescript theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
export default new sdk.IntegrationDefinition({
  ...
})
  .extend(creatable, () => ({}))
```

## Next steps

Since each interface has its own specific requirements, you should refer to the interface documentation for more information.

> [card] [Human in the loop](https://botpress.com/docs/integrations/sdk/interface/how-tos/implementing-hitl.md)
>
> How to implement Human in the loop


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.