Skip to content

graphland-dev/waland-sdks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waland SDK

Official client libraries for the Waland WhatsApp API.

Packages

Language Package Path
Node.js waland packages/node
PHP waland/waland packages/php
Go github.com/graphland-dev/waland-sdks/packages/go packages/go
Rust waland packages/rust

Credentials

Open the merchant console:

  • API key — create or copy your organization API key (waland_...).
  • Session ID — go to WhatsApp accounts, connect your number by scanning the QR code, then copy the session ID for that connected account.

Node.js

npm install waland
import { WalandClient } from "waland";

const client = new WalandClient(
  process.env.WALAND_API_KEY!,
  process.env.WALAND_SESSION_ID!,
);

await client.sendMessage({
  chatId: "8801712345678@s.whatsapp.net",
  text: "Hello from Waland",
});

PHP

composer require waland/waland
use Waland\WalandClient;

$client = new WalandClient(
    getenv('WALAND_API_KEY'),
    getenv('WALAND_SESSION_ID'),
);

$client->sendMessage([
    'chatId' => '8801712345678@s.whatsapp.net',
    'text' => 'Hello from Waland',
]);

Go

go get github.com/graphland-dev/waland-sdks/packages/go
client, _ := waland.NewClient(
    os.Getenv("WALAND_API_KEY"),
    os.Getenv("WALAND_SESSION_ID"),
    nil,
)

client.SendMessage(context.Background(), waland.SendMessageParams{
    ChatID: "8801712345678@s.whatsapp.net",
    Text:   "Hello from Waland",
})

Rust

cargo add waland
use waland::{SendMessageParams, WalandClient};

#[tokio::main]
async fn main() {
    let client = WalandClient::new(
        std::env::var("WALAND_API_KEY").unwrap(),
        std::env::var("WALAND_SESSION_ID").unwrap(),
        None,
    ).unwrap();

    let _ = client.send_message(SendMessageParams {
        chat_id: "8801712345678@s.whatsapp.net".to_string(),
        text: Some("Hello from Waland".to_string()),
        media_url: None,
        media_filename: None,
    }).await;
}

See packages/node/README.md, packages/php/README.md, packages/go/README.md, and packages/rust/README.md for full API docs.

PHP development (monorepo)

Root composer.json is what Packagist indexes. packages/php/composer.json is a copy for working in that directory only.

composer install   # repo root
composer test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors