Open the interfaces directory
interfaces
directory of the botpress/botpress repository.Find the interface
Find the name and version
interface.definition.ts
file to find the interface name
and version
.Open the package.json file
package.json
file.Add the bpDependencies section
bpDependencies
section in your integration’s package.json
file, create one:Add the interface as a dependency
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:"<interface-name>": "interface:<interface-name>@<version>"
.Save the package.json file
package.json
file.Install the interface
bp add
command to install it. This command will:bp_modules
in your integration’s root directory.Open the package.json file
package.json
file.Add the build script
scripts
section, add the following script:build
script already exists in your package.json
file, please replace it.Save the package.json file
package.json
file.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.
Open the integration.definition.ts file
integration.definition.ts
file.Import the interface
creatable
, you would add the following import statement:Extend your definition
.extend()
function at the end of your new IntegrationDefinition()
statement. For example, with an interface named creatable
, you would add the following: