Skip to main content

Adapters

Adapters convert information provided by channels (Telegram, Whatsapp) for each specific provider to XMessage and vise versa.

Adapters are gateway to the external services and resposible for recieving user response and sending response to users. Adapters are the main component which enable the system to work generically with any provider or channel.

Think of adapters as plugins to the system, where each added plugin adds a new functionality (capability to work with a new channel + provider combination) to the system.

The Inbound service directly uses these adapters as dependent packages to integrate with different channels.

Thus the two major functions of Adapters are:

  • Convert API/webhook data from channel (and provider) to XMessage
  • Convert XMessage back to API/webhook data format for the specific channel(and provider)



Adapters belong to one of the following types:

  • EMAIL (Used to work with Email providers, for example, Nodemailer)
  • SMS (Used to work with SMS providers, for example, TwilioSms)
  • CHAT (Used to work with Chat providers, for example, WhatsappGupshup)
  • XMESSAGE (These are generic type of adapters which can directly work on XMessages and integrate with any provider/channel)

Learn more about how to create an adapter for a new channel + provider combination here.