Introducing The Elarian Framework

By Saba Gul

Today, we are proud to announce Elarian—a powerful new framework for building reactive customer-facing applications with dramatically less effort, resources, and time.

Why Elarian

We are the team behind Africa’s Talking. In building the communication APIs powering Africa’s digital ecosystem, we have been writing code and servicing developers across the continent for the last 10 years.

In this time, many great tools that improve the developer experience and productivity have come into the market, accelerating software development. Yet, when it comes to customer-centric software, developers still juggle significant, unnecessary complexity in designing and managing it.

The Problem

As the scale of your customer base and engagement goes up, the load of:

  • Maintaining customer profiles
  • Building and accessing databases and caches
  • State and event handling

all make the management of code complex, costly and time-consuming.

With Elarian, you scale the solution — not your time, cost, or infrastructure needs.

The Elarian Promise

While building Elarian, we had the needs and challenges of developers in mind—whether you are an individual operator, a small team of developers, or a business with a large user base.

At the heart of Elarian is our mission to radically enhance the experience and productivity for developers of every stripe—so they can build and test better, faster. This means shorter product development cycles and faster product innovation.

Elarian is a category-defining product in customer engagement. At its core, it is a customer data and automation framework, that gives developers a competitive advantage. Out of the box, it provides communications, payments, storage, reminders, and analytics infrastructure. This infrastructure is provided as a service, to interact with programmatically.

The Power of Elarian: 4 Core Offerings

  1. Engagement Automation: Elarian is built for customer state and engagement management
  2. Programmable Customer Objects: we define and manage the customer entity for you, and let you program against individual customer entities.
  3. Code Against Customer Data: Elarian lets you issue simple customer commands, making it more efficient to write, reason about, maintain and organize code.
  4. React Swiftly to Each Customer: Elarian is built to be highly reactive, so you can process customer actions using a simple event-based model, without the implementation overhead.

Below, we discuss in more detail, with examples, the 4 most notable features of Elarian that make it a powerful framework that simplifies building and maintaining applications like the above.


1. Built for Customer State and Engagement Management

Building customer-centric software requires an effortless way to capture, track and react to customer engagement, events and state. We call this engagement automation.

This starts with defining a customer, which is central to Elarian. In our programming model, everything happens in the context of a customer. The customer forms the basic unit of abstraction, with programmable customer objects (more on this next), that allow for coding against a single customer, and building around their journey and state.

In our Event-Driven Model:

  • Engagement data is stored by the customer.
  • Each state handler is written from the perspective of a single customer.
  • A key-value store is provided for customer state.

Elarian creates a record of everything your application has done with a single customer. This allows you to readily access customer data and analyze customer engagement, without the overhead of designing and managing complex database deployments.

Elarian is built on the BYOC (Bring Your Own Channel) principle. We believe how you interact with your customer should stay the same, no matter the channel. So you can configure any channel from any infrastructure provider, e.g., Africa's Talking, Twilio, Stripe, Mailgun, Daraja, and so on—and connect and consume functionality with a unified interaction model, without the implementation overhead. In other words, Elarian connects to various service providers like Twilio, enhancing how you interact with channels from these providers by adding a robust data layer and reactive programming model to provide you with a fast, scalable build experience. The application code maintains the same semantics whether sending an email or chat. It is also possible to change the underlying provider without having to update the code.

What This Allows You To Do:

  • Organize, track and merge customer states across channels. If you have interacted with the same customer across different communication channels, you can merge the two customer entities within Elarian into one customer. This will adopt all of the state from customer B into customer A and discard customer B.
  • Manage engagement-related and non-engagement related customer state easily.
  • Access a readily-available cache of customer engagements, where you can read data from the customer’s perspective. These range from sent messages and processed payments to tracked customer activities.
  • Easily track and build your business logic around each customer’s profile, journey and state.
  • Initiate engagements through configured providers, and on each customer’s preferred channel. Your application code retains the same semantic whether sending an email or a chat.
  • Track individual customer events and interactions to understand the impact of each customer engagement and communication, if, for example, you are engaging customers on multiple channels such as email, SMS and Whatsapp. This forms the basis of targeted engagement and contextual decision-making.

2. Programmable Customer Objects

Elarian SDKs offer a customer-centric programming model. You issue commands e.g. customer.addReminder(data) and are notified when data about your customer changes e.g. elarian.on('reminder', (data, customer) => {...})

Elarian’s customer objects give you powerful, programmatic access to customer data. Engagement data is sorted by customer, providing a unified customer view. This means event handlers will receive a customer object belonging to the customer that initiated the engagement.

Elarian provides a storage and runtime environment for each customer and carries the load of maintaining profiles, caches, state, and event-handling for each. In line with the customer being the unit of scale, all data that a customer generates is stored in the customer's perspective, making it easy for your application to build a better profile of the customer's behaviour, without adding complexity to your code logic, database, infrastructure or analytics needs.


What This Allows You To Do:

  • Easy customer segmentation for targeted messaging, fragmented pricing, or personalization of customer experiences.
  • Event-handling and scheduling actions become extremely straightforward, without the need for additional infrastructure. The event handler receives a customer object belonging to the customer that initiated the engagement, or in case of scheduling, that the reminder was set on.
  • Drive deep customer insights by adding a metadata layer on top to contextualize the customer segments even further, and surface more similarities between customers over time.

3. Code Against Customer Data

Elarian is an SDK that provides infrastructure, which means you interact only with Elarian. Coding against customer data makes it more efficient to write, reason about, maintain, and organize code. Most actions on Elarian are done from a customer's perspective.

Once you create a customer by initializing a new customer object, you can issue them simple commands, such as: getState, updateMetadata, updateAppData, addReminder, and sendMessage. With these commands at your disposal, you can abstract away communication protocols.

4. React To The Customer

Elarian sets up a persistent bi-directional link between your application and the Elarian server. A considerable advantage you gain from this is not needing to configure webhooks and HTTP servers.

We manage webhooks with the infrastructure providers and relay traffic via an event-driven model. This allows applications to react to engagement events or state changes over the persistent connection, making it possible to build highly reactive applications.

Customer As The Stateful Actor

  • In Elarian, every customer object is an actor, with corresponding state containing the records of everything your application has done with the customer.
  • The customer you interact with is a virtual customer object (actor) inside Elarian.
  • The customer state includes your most recent interactions with the customer as well as any other additional state your application would like to track.

Getting a customer’s state is then straightforward—see below.

const alice = new elarian.Customer({
  number: '+167890',
  provider: 'cellular'

const state = await alice.getstate();

  customerId: '...',
  paymentState: {},
  identityState: {},
  activityState: {},
  messagingState: {}

Each customer triggers events by performing specific actions, and your application reacts by performing actions that may, in turn, result in more events. Thus, the primary stateful actor is the customer, and an optimal approach is to code against this customer (actor) as the main unit of abstraction.

Case Study: Loaner App

Imagine you’re building a fintech app that provides loan facilities; let’s call it Loaner. To request loans, your customers interact with your app through a WhatsApp interface. In addition, your app needs to send highly targeted and personalized messages to encourage more engagement from customers. Building such an app at scale gets complex fast.

You need a system to allow customers to request loans, receive funds in their mobile wallets, pay back loans, and receive occasional reminders about their loans.

With Elarian, you can build a fully functioning app that does all of this, with about 260 lines of code, with no DBs, no queues, and no complicated logic.

Your application can also swiftly react to any data changes, via notifications generated when a customer’s data changes, e.g. when a customer sends you a payment or when a reminder fires. Some notifications include: onReminder, onReceivedWhatsapp, onReceivedPayment and onVoiceCall.

Let’s take the example of receiving an SMS from a customer. All you need to do is set an event listener as shown here:

async function onReceivedSms(notification, customer) {
  console.log('Received SMS notification -> ', notification);
  // respond to customer
  const { messageId } = notification;
  const response = {
    body: {
      text: 'Hello There!'
  await customer.replyToMessage(messageId, response);

elarian.on('receivedSms', onReceivedSms);

Note that the customer parameter sent to the event handler represents the customer sending you an SMS. We describe this as using the customer as the unit of abstraction. This customer-centric pattern makes it easier to write complex logic.


Q1. What if I’m already using products like Africa’s Talking or Twilio?

A. As we mention above, Elarian is built on the BYOC (Bring Your Own Channel) principle. This means you can configure any channel from any infrastructure provider, e.g., Africa's Talking, Twilio, Stripe, Mailgun, Daraja, and so on—and connect and consume functionality with a unified interaction model. In other words, Elarian connects to various service providers, enhancing how you interact with channels from these providers by adding a robust data layer and reactive programming model to provide you with a fast, scalable build experience.

Q2. Is Elarian a database?

A. Some aspects of Elarian can be considered database-like, but it's not a traditional database compared to MySQL, MongoDB, Cassandra e.t.c

The data stored in Elarian is the engagements generated by end-users as they call/text/pay/dial ussd codes, e.t.c, and arbitrary key<>value maps that you store concerning a customer using your service. For instance, if you were building a survey application, you can store what question you expect the customer to answer next.

Q3. How much does Elarian cost?

A. Elarian uses a Pay As You Go model, meaning you pay for only what you use. We charge for the amount of Monthly Active Users, Engagement Credits, Fragment Minutes and Analytics Minutes consumed in a month. The free tier allocates $140 worth of credits every month to get you started building with Elarian. Learn more from the Elarian pricing page.

Learn More

Read more about Elarian, or check out the documentation for more examples and code samples.

If you have questions, comments, or need help with code, we would be delighted to help:

Sign up here to try out Elarian for yourself today—no strings attached. As they say, the proof is in the pudding itself!

Ready to get started ?

Copyright Elarian 2022