loginwa
OfficialProvides tools for interacting with the LoginWA WhatsApp API, including device status, OTP verification, sending messages, and broadcasts.
LoginWA Client SDKs & Tools
Client-side assets for integrating the LoginWA WhatsApp API, OTP, messaging, media, broadcast, devices and webhooks. JavaScript, PHP and Android SDKs, an embeddable OTP widget, and a Postman collection. No server code is included.
Contents
js/, JavaScript SDK (ESM), dependency-free client.php/, PHP SDK (cURL-based, PHP >= 8.0).android/, Android SDK (Kotlin library + runnable sample app).mcp/, TypeScript MCP server (@loginwa/mcp): device status, OTP, send, broadcast for AI agents. Install withnpx -y @loginwa/mcp. Seemcp/README.md.snippet/otp-widget.html, drop-in OTP widget example.docs/postman/loginwa-api.postman_collection.json, Postman collection.docs/sdk.md, quick reference for these assets.
Paths are relative to the repository root. Inside the LoginWA application
repository these same files live under laravel-app/sdk/, which is the single
source they are published from, edit them there, never here.
Related MCP server: zaileys-mcp
API Basics
Base URL (host):
https://api.loginwa.comSDK default (includes version prefix):
https://api.loginwa.com/api/v1Auth:
Authorization: Bearer <YOUR_API_KEY>(orX-Api-Key)Content-Type:
application/jsonAlso reachable at
https://loginwa.com/api(same routes under/api/…)
OTP product paths: SDKs call /auth/start and /auth/verify against the
/api/v1 base (i.e. POST /api/v1/auth/start|verify). The preferred narrative
docs path /api/auth/start|verify is equivalent for sending/verifying codes;
v1 start responses also include sent_via_engine and quota_remaining, and
v1 verify returns phone (not phone_number).
Quick Start
JavaScript SDK
cd sdk/js
npm install
# import into your app (ESM)import { LoginWAClient } from '@loginwa/sdk';
const client = new LoginWAClient({ apiKey: process.env.LOGINWA_API_KEY });
try {
const start = await client.startOtp({ phone: '6281234567890', countryCode: '62' });
const verify = await client.verifyOtp({ sessionId: start.session_id, otpCode: '123456' });
console.log('verified', verify);
} catch (err) {
console.error('OTP error', err?.status, err?.data || err.message);
}PHP SDK
cd sdk/php
composer install<?php
require __DIR__ . '/vendor/autoload.php';
$client = new LoginWA\SDK\Client('YOUR_API_KEY');
try {
$start = $client->startOtp(['phone' => '6281234567890', 'country_code' => '62']);
$verify = $client->verifyOtp(['session_id' => $start['session_id'], 'otp_code' => '123456']);
var_dump($verify);
} catch (\LoginWA\SDK\ApiException $e) {
// HTTP status is in $e->getCode()
echo 'OTP error: ' . $e->getCode() . ' ' . $e->getMessage();
}MCP server (@loginwa/mcp)
cd sdk/mcp && npm install && npm run build
# clients: npx -y @loginwa/mcpSet LOGINWA_API_KEY. Details and client configs: mcp/README.md.
OTP Widget Snippet
Open sdk/snippet/otp-widget.html, set your API key/Base URL, and embed in any page. Uses Fetch to call /auth/start and /auth/verify.
Postman Collection
Import docs/postman/loginwa-api.postman_collection.json, set base_url (default https://api.loginwa.com) and api_key variables, then run the flows.
Common errors
401 unauthorized, missing/invalid API key.402 subscription_suspended, inactive, suspended, or past-due subscription.422 invalid_code|expired|blocked, verification failed.429 quota_exceeded, monthly plan quota exceeded.429 rate_limited, too many requests per minute (Retry-Afterheader).503 no_device_connected, no online WhatsApp device for the app.Network/timeout, retry with backoff; SDK throws with HTTP status in error object/exception code.
Download
Packaged ZIP (same contents as this repo): https://loginwa.com/loginwa-batch1-sdk.zip
Changelog
See CHANGELOG.md.
Support
Questions/feedback: dev@loginwa.com
This server cannot be installed
Maintenance
Related MCP Servers
- Flicense-qualityCmaintenanceWhatsApp MCP server that exposes messaging, groups, contacts, and profile management as tools and resources for AI agents, supporting Baileys and Meta Cloud API.19
- AlicenseBqualityBmaintenanceEnables AI agents to control WhatsApp, including sending messages and media, reading chats, managing groups and communities, with QR/pairing auth and session persistence.14262MIT
- FlicenseAqualityCmaintenanceMCP server for Kirimi WhatsApp API, enabling AI agents to send messages, broadcast, manage devices, and contacts.7
- Alicense-qualityBmaintenanceA self-hosted WhatsApp gateway that exposes messaging capabilities via MCP, allowing AI agents to send, receive, and manage WhatsApp messages through a single-command setup with SQLite storage.1MIT
Related MCP Connectors
Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.
Zero-setup WhatsApp notifications + human-in-the-loop for AI agents — text 'join', send in 60s.
Real physical SIMs for AI agents: SMS verification and rentals. 145+ countries, 2500+ services.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/satuapps/loginwa-sdk'
If you have feedback or need assistance with the MCP directory API, please join our Discord server