For the complete documentation index, see llms.txt. This page is also available as Markdown.

SDKs

Are you missing an SDK? Feel free to contribute one, and we will reward you with a lifetime license for creating and maintaining the library.

PHP

A general PHP library that can be used in any PHP product.

Official:

composer require justpush/justpush-php-sdk
$response = JustPushMessage::token('YOUR_API_TOKEN')
    ->message('The nightly backup finished')
    ->title('Backups')
    ->create();
Javascript

A general Javascript library that can be used in any Javascript product.

Official:

TypeScript

A general TypeScript library that can be used in any TypeScript application.

Official:

Python

A Python library for scripts, servers and Home Assistant integrations. It has a sync client that only uses the standard library, and an async client built on aiohttp. Python 3.10 or newer.

Official:

pip install justpush
from justpush import JustPush, Priority

client = JustPush("YOUR_API_TOKEN")
result = client.send(
    "The nightly backup finished",
    title="Backups",
    topic="Servers",
    priority=Priority.HIGH,
)

print(result.key)                    # use it with client.get_message()
print(result.rate_limit.remaining)   # messages left this month

The SDK checks the message before sending, so an invalid value raises JustPushValidationError instead of making a request. client.verify_token() checks an API token without sending a message or using quota. For async code, use AsyncJustPush, which can share your own aiohttp.ClientSession.

Go

A Go library for programs, servers and CLIs. It only uses the standard library and has no dependencies. Go 1.21 or newer.

Official:

go get github.com/JustPush-io/justpush-go-sdk
import "github.com/JustPush-io/justpush-go-sdk"

client, err := justpush.New("YOUR_API_TOKEN")
if err != nil {
    log.Fatal(err)
}

result, err := client.Send(ctx, &justpush.Message{
    Title:    "Backups",
    Message:  "The nightly backup finished",
    Topic:    "Servers",
    Priority: justpush.PriorityHigh,
})
if err != nil {
    log.Fatal(err)
}

fmt.Println(result.Key)                 // use it with client.GetMessage()
fmt.Println(result.RateLimit.Remaining) // messages left this month

Every method takes a context.Context, and a Client is safe to share between goroutines. Errors work with errors.Is and errors.As. For example, client.VerifyToken(ctx) returns justpush.ErrUnauthorized for an invalid token, without sending a message or using quota.

What the SDKs support

The PHP, Python and Go SDKs cover the full Messages and Topics API:

  • Title, message, topic (by name or by topic token), priority and sound

  • Up to 10 buttons and up to 4 button groups

  • Up to 10 images, from a URL, raw bytes or a file

  • Expiry (TTL) and acknowledgements with retries and a callback URL

  • Looking up a sent message by its key

  • Creating, updating and fetching topics

Last updated