SDKs & Libraries

To make integration with our WhatsApp API service easier, we provide official SDKs for popular programming languages and frameworks. This page lists available SDKs and community-maintained libraries.

Official SDKs

Our official SDKs provide a convenient way to interact with the WhatsApp API service from your preferred programming language.

JavaScript/Node.js

Installation

npm install whatsapp-api-client

Basic Usage

const WhatsAppClient = require('whatsapp-api-client');

const client = new WhatsAppClient({
  apiKey: 'YOUR_API_KEY'
});

async function sendMessage() {
  try {
    const result = await client.messages.sendText({
      sessionId: 'session_123abc',
      to: '14155552671',
      text: 'Hello from the WhatsApp API!'
    });
    
  } catch (error) {
  }
}

Python

Installation

pip install whatsapp-api-python

Basic Usage

from whatsapp_api import WhatsAppClient

client = WhatsAppClient(api_key='YOUR_API_KEY')

def send_message():
    try:
        result = client.messages.send_text(
            session_id='session_123abc',
            to='14155552671',
            text='Hello from the WhatsApp API!'
        )
        
        print(f"Message sent: {result['data']['messageId']}")
    except Exception as e:
        print(f"Failed to send message: {e}")

PHP

Installation

composer require messaging/whatsapp-api-php

Basic Usage

<?php
require_once 'vendor/autoload.php';

use Messaging\WhatsAppApi\Client;

$client = new Client('YOUR_API_KEY');

try {
    $result = $client->messages->sendText([
        'sessionId' => 'session_123abc',
        'to' => '14155552671',
        'text' => 'Hello from the WhatsApp API!'
    ]);
    
    echo "Message sent: " . $result['data']['messageId'];
} catch (Exception $e) {
    echo "Failed to send message: " . $e->getMessage();
}
?>

Java

Installation

Maven:

<dependency>
    <groupId>com.messaging</groupId>
    <artifactId>whatsapp-api-java</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle:

implementation 'com.messaging:whatsapp-api-java:1.0.0'

Basic Usage

import com.messaging.whatsapp.WhatsAppClient;
import com.messaging.whatsapp.models.TextMessage;
import com.messaging.whatsapp.responses.MessageResponse;

public class WhatsAppExample {
    public static void main(String[] args) {
        WhatsAppClient client = new WhatsAppClient("YOUR_API_KEY");
        
        try {
            TextMessage message = new TextMessage()
                .sessionId("session_123abc")
                .to("14155552671")
                .text("Hello from the WhatsApp API!");
                
            MessageResponse response = client.messages().sendText(message);
            System.out.println("Message sent: " + response.getData().getMessageId());
        } catch (Exception e) {
            System.err.println("Failed to send message: " + e.getMessage());
        }
    }
}

Community Libraries

These libraries are maintained by the community and provide additional functionality or integration with specific frameworks.

Library Language/Framework Description Links
whatsapp-api-react React React components and hooks for WhatsApp API integration GitHub | NPM
whatsapp-api-laravel Laravel Laravel package for WhatsApp API integration GitHub | Packagist
whatsapp-api-django Django Django app for WhatsApp API integration GitHub | PyPI
whatsapp-api-go Go Go client for WhatsApp API GitHub
whatsapp-api-ruby Ruby Ruby gem for WhatsApp API integration GitHub | RubyGems

SDK Features

Our official SDKs provide the following features:

  • Complete API Coverage: All API endpoints are supported
  • Type Safety: Type definitions for request and response objects
  • Error Handling: Structured error handling with detailed error information
  • Authentication: Built-in API key authentication
  • Rate Limiting: Automatic handling of rate limit errors with retry capabilities
  • Webhook Verification: Utilities for verifying webhook signatures
  • Pagination: Helper methods for paginated endpoints
  • Logging: Configurable logging for debugging

Contributing

We welcome contributions to our SDKs and libraries! If you'd like to contribute, please follow these steps:

  1. Fork the repository on GitHub
  2. Create a new branch for your feature or bug fix
  3. Make your changes and add tests if applicable
  4. Run the tests to ensure they pass
  5. Submit a pull request with a clear description of your changes

For more detailed information, please see the CONTRIBUTING.md file in each repository.

Support

If you encounter any issues with our SDKs or have questions about integration, you can get help through the following channels:

  • GitHub Issues: Report bugs or request features through the GitHub repository
  • Documentation: Comprehensive documentation is available for each SDK
  • Support Portal: Premium support is available for paid plans
  • Community Forum: Discuss with other developers in our community forum