• This repository has been archived on 07/Jun/2023
  • Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    TypeScript
  • License
    Other
  • Created almost 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The official Meta Business Messaging WhatsApp Cloud API Node.js SDK.

WhatsApp Business Platform Node.js SDK for the Cloud API, hosted by Meta

WhatsApp Logo


Status

THIS PROJECT IS ARCHIVED.

To learn more about reasons why we stopped the development of this SDK, visit this GitHub issue.


Welcome to SDK for the WhatsApp Business Platform. This SDK is written for Node.js framework to simplify access to the Cloud API. The source code itself is written in Typescript with TypeScript declaration files to type-check usage of the WhatsApp Business Platform Node.js SDK in your code, along with hints and code completion in TypeScript compatible IDEs.

lint, prettify, spellcheck, test, and build generate docs

Getting started

View the quick start documentation to learn how to use the SDK and get started.

Installation

Install the WhatsApp Business Platform SDK using yarn:

yarn add whatsapp

Or npm:

npm install whatsapp

Configuration

The SDK uses environmental variables for setting all the configuration. For development purposes, you can use a .env file at the root of your project. Below are all the possible options for the SDK configuration and only some are required for certain features.

# The base URL to send all SDK requests to (default graph.facebook.com).
# This variable should not be used unless necessary for development or special routing needs.
WA_BASE_URL=

# Your Meta for Developers app Id.
M4D_APP_ID=

# Your Meta for Developers Business app secret.
M4D_APP_SECRET=

# Your WhatsApp phone number Id (sender).
WA_PHONE_NUMBER_ID=

# Your WhatsApp business account Id.
WA_BUSINESS_ACCOUNT_ID=

# System user access token. Recommended: Do not use a temporary access token.
CLOUD_API_ACCESS_TOKEN=

# Cloud API version number.
CLOUD_API_VERSION=v16.0

# Customize your incoming webhook listener endpoint. Path should be
# https://{host}/{WEBHOOK_ENDPOINT}. A trailing slash is not added by default,
# so the variable should include that if it's required by your API gateway.
WEBHOOK_ENDPOINT=

# A custom verification token string to validate incoming webhook payloads.
# Needs to match webhook configuration.
WEBHOOK_VERIFICATION_TOKEN=

# Override the default app listener port (port 3000).
LISTENER_PORT=

# Turn on global debug logging
DEBUG=

# The number of request retries after waiting (default 30 retries)
MAX_RETRIES_AFTER_WAIT=

# The timeout period in milliseconds for a request to wait for a response (default 20000ms)
REQUEST_TIMEOUT=

Code of Conduct

Meta has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contribute

See the CONTRIBUTING file for our development process, how to propose bugfixes and improvements, and how to build and test your changes to the WhatsApp Business Platform Node.js SDK.

License

The WhatsApp Business Platform Node.js SDK for the Cloud API is Meta Platforms licensed, as found in the LICENSE file.

More Repositories

1

stickers

This repository contains the iOS and Android sample apps and API for creating third party sticker packs for WhatsApp.
Java
2,711
star
2

proxy

This repository contains the WhatsApp proxy implementation for users to host their own proxy infrastructure to connect to WhatsApp for chat (VoIP is not currently supported)
Shell
1,163
star
3

waraft

An Erlang implementation of RAFT from WhatsApp
Erlang
508
star
4

eqwalizer

A type-checker for Erlang
Erlang
477
star
5

erlfmt

An automated code formatter for Erlang
Erlang
391
star
6

WhatsApp-Business-API-Setup-Scripts

The scripts related to setting up WhatsApp business API
373
star
7

erlt

Early prototype of ErlT, an experimental Erlang dialect with first-class support for static typing.
Erlang
127
star
8

StringPacks

Extracts localized strings from an Android app and stores it in a much more efficient format.
Java
124
star
9

erlfuzz

erlfuzz is a fuzzer for the Erlang ecosystem
Rust
112
star
10

erlang-language-platform

Erlang Language Platform. LSP server and CLI.
Rust
77
star
11

power_shell

Erlang shell with advanced features: evaluating non-exported functions and shortcuts for frequently used functions.
Erlang
74
star
12

tree-sitter-erlang

Tree-sitter Grammar for Erlang
C
65
star
13

WADebug

WhatsApp Debug - A command-line tool that will be used to troubleshoot installation of WhatsApp Business API.
Python
30
star
14

whatsapp-business-api-deployment-templates

This repo hosts the cloud templates which enable one-click deployment of their WhatsApp Business Platform On-Premise API on different cloud platforms with stable high messaging throughput.
HCL
24
star
15

erldist_filter

erldist_filter NIF for filtering and logging Erlang Dist Protocol messages
C
13
star
16

WhatsApp-OTP-Sample-App

Sample app that integrates with WhatsApp OTP (One-Time Password) copy code and "one-tap" autofill features. This project shows how to send and receive OTP code from WhatsApp and best practices around integration.
Swift
10
star
17

WhatsApp-Android-OTP-SDK

WhatsApp Android OTP SDK helps you integrate with one-time password solution provided by WhatsApp.It provides handy functions that simplifies the integration work.
Java
4
star
18

WhatsApp-Flows-Tools

Tools and examples to help you create WhatsApp Flows https://developers.facebook.com/docs/whatsapp/flows
1
star