The official Go library for Calisero is published and ready for production. It covers the whole API — messages, OTP verifications, opt-outs and account details — for backend services, workers and command-line tools.
What it includes
No dependencies. Built on the standard library's net/http only: nothing else to download or audit.
Context on every call. Every method takes a context.Context, to set a timeout or cancel the request. A client is safe for concurrent use from several goroutines.
Typed. Typed requests, responses and errors, with message statuses as constants rather than hand-written strings.
OTP in two calls. Start a verification, then validate the code the user typed. Calisero generates, sends and checks the code, so your application never stores it.
Delivery webhooks. DeliveryWebhookHandler is a ready http.Handler: it reads and validates every delivery report and hands it to your code as a typed object. An optional secret token in the callback address turns away requests that do not carry it.
Clear errors. Every kind of failure has its own error type, found with errors.As, carrying the API's message and the request's trace ID — the one you debug any request with.
Romania time handled. Pass a time.Time to schedule a message and the library converts it to the time zone the API expects.
URL shortening. Turn on link shortening for a message and track the clicks on its links.
Getting started
Add the module to your project:
go get github.com/calisero/calisero-go
Then send your first message with your API key:
package main
import (
"context"
"fmt"
"log"
"os"
calisero "github.com/calisero/calisero-go"
)
func main() {
client, err := calisero.NewClient(os.Getenv("CALISERO_API_KEY"))
if err != nil {
log.Fatal(err)
}
response, err := client.Messages.Create(context.Background(), &calisero.CreateMessageRequest{
Recipient: "+40742123456",
Body: "Your order has shipped and arrives tomorrow.",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Data.ID, response.Data.Status)
}
With a sandbox API key you try every call without sending or paying for real messages.
The library needs Go 1.22 or later and is tested on Go 1.22–1.27, on Linux, macOS and Windows. The source code is public on GitHub, with runnable examples for every operation, and the reference documentation is on pkg.go.dev.
Keep your API key on the server: the library is meant for server-side code, never for a client application.
All the official libraries
With Go and Python, the integrations page now lists six official libraries: PHP, Laravel, Symfony, Node.js, Go and Python.