Skip to main content

Getting started

hypersender-laravel is the Hypersender package for Laravel Rust. It gives your app three services, Whatsapp, Sms and Otp, and two webhook routes that turn every Hypersender webhook into a Laravel event. It is the Rust version of the Laravel (PHP) package and reads the same environment variables.

Prerequisites

  • Rust 1.99 or higher, the version Laravel Rust needs.
  • A Laravel Rust app. Create one with laravel new example-app --rust.
  • A Hypersender account. Sign up at Hypersender to get your API key and Instance ID.
You can find your API key and Instance ID in the Hypersender dashboard
Hypersender Dashboard API Key

Installation

1

Add the crate

From your app’s root directory:
2

Register the service provider

Laravel Rust packages are wired in through a service provider. Add it to with_providers in src/app.rs:
src/app.rs
3

Add your keys to .env

Set only the products you use:
.env

Send your first message

Inject Whatsapp into any handler, listener, job or command:
Register it like any route, for example route.get("/send", send); in src/routes/web.rs. Every method returns the Laravel HTTP client’s Response. When Hypersender answers with a non-2xx status, the method returns an error, so ? stops on it. Read the body with response.json::<serde_json::Value>()? or response.text(). If an instance ID is missing, resolving that service fails with a message naming the variable to set, for example HYPERSENDER_WHATSAPP_INSTANCE_ID.

Configuration

All settings live in the HypersenderConfig section: To change a value in code, edit the section in with_config. Your app’s callbacks run after the package’s, so they win:
src/app.rs

Testing your app

The package sends requests through Laravel’s HTTP client, so client::fake() intercepts them and your tests never reach Hypersender:

Next steps

Send WhatsApp messages

Text, images, files, video, voice, locations and polls.

WhatsApp webhooks

Incoming messages as Laravel events.

Send SMS

SMS from your own Android phone.

OTP

Send and check one-time codes, or send a login link.
Last modified on December 2, 2026