Skip to content

Adapter development

Wade Penistone edited this page Feb 10, 2019 · 10 revisions

Creating an adapter

Prerequisites

You will need a functioning Mind Stack instance on your development machine using another adapter, to confirm that you have a bot instance ready to attach the adapter you are developing to.

Also you will need a new git repo setup with the naming scheme being mindstack-<adapter-name>
(eg mindstack-discord)

Finally you will need some development knowledge or documentation of the service you are planning to integrate with (if supported).

Boilerplate

You can generate boilerplate code for an adapter by using the Official generator. This will be enough to get you started on writing your own code.

Configuration

The majority of the development work is actually configuration. Due to the way Mind Stack is built, not much coding is needed for an adapter to actually function.

The configuration is split into sections as follows (inside srs/index.js):

Info

Descriptive information about adapter

Client

Client configuration

Input

Input configuration

Output

Output configuration

Var

Variable configuration

User

Handle user data association

Tags (Skip if using generator)

Make sure to include the following tags (if your adapter is public) under the keywords section of your package.json:

  • mindstack
  • adapter

Example

"keywords": [
    "mindstack",
    "adapter"
  ],