Skip to content

x-spacy/message-builder

Repository files navigation

Message Builder

Description

A fully typed message builder created using TypeScript. A better way to creating messages for consume the WhatsApp Business API.

Installation

npm install @x-spacy/message-builder

Usage

import { MessageBuilder, MessageType } from '@x-spacy/message-builder';

const message = MessageBuilder.newBuilder()
  .to('000000000000')
  .type(MessageType.TEXT)
  .text((builder) => {
    builder.body('Hello world!');
  })
  .build();

License

X-Spacy LTDA is MIT Licensed.