Docs › Push Notifications

Send a Push Notification

The fastest way to get a push notification on your phone from a script, cron job, or app — one function call, no server or push certificates to manage.

Overview

How it works

NotiLens handles delivery for you. Install the SDK or CLI, register a source once, then call notify() any time you want a push notification — NotiLens routes it to the NotiLens app on your phone or browser.

This page covers just the one-line case. For task lifecycle tracking, metrics, and anomaly detection, see the full SDK & CLI docs.

Setup

1. Install

Python
Node.js
PHP
Go
Ruby
Java / Kotlin
Rust
Shell (CLI)
pip install notilens
npm install @notilens/notilens
composer require notilens/notilens
go get github.com/notilens/sdk-go
gem install notilens
<!-- Maven -->
<dependency>
  <groupId>com.notilens</groupId>
  <artifactId>notilens</artifactId>
  <version>0.4.1</version>
</dependency>

// Gradle (Kotlin DSL)
implementation("com.notilens:notilens:0.4.1")
# In Cargo.toml:
notilens = "0.5"

# Or via CLI:
cargo add notilens
curl -fsSL https://raw.githubusercontent.com/notilens/sdk-shell/main/notilens.sh \
  -o /usr/local/bin/notilens && chmod +x /usr/local/bin/notilens

2. Get credentials

Sign up at app.notilens.com, create a source, and copy its token and secret.

Send

3. Send your first notification

Initialise once with your credentials, then call notify() — that's the whole integration.

Python
Node.js
PHP
Go
Ruby
Java / Kotlin
Rust
Shell (CLI)
import notilens

nl = notilens.init(name="my-script", token="YOUR_TOKEN", secret="YOUR_SECRET")
nl.notify("payment.received", "$299 from Stripe")
import { NotiLens } from '@notilens/notilens';

const nl = NotiLens.init('my-script', { token: 'YOUR_TOKEN', secret: 'YOUR_SECRET' });
nl.notify('payment.received', '$299 from Stripe');
$nl = NotiLens::init('my-script', token: 'YOUR_TOKEN', secret: 'YOUR_SECRET');
$nl->notify('payment.received', '$299 from Stripe');
import notilens "github.com/notilens/sdk-go"

nl, err := notilens.Init("my-script", notilens.Options{
    Token:  "YOUR_TOKEN",
    Secret: "YOUR_SECRET",
})
nl.Notify("payment.received", "$299 from Stripe")
require "notilens"

nl = NotiLens.init("my-script", token: "YOUR_TOKEN", secret: "YOUR_SECRET")
nl.notify("payment.received", "$299 from Stripe")
import com.notilens.NotiLens;

// Java
NotiLens nl = NotiLens.init("my-script", "YOUR_TOKEN", "YOUR_SECRET");
nl.notify("payment.received", "$299 from Stripe");

// Kotlin
val nl = NotiLens.init("my-script", "YOUR_TOKEN", "YOUR_SECRET")
nl.notify("payment.received", "$299 from Stripe")
use notilens::NotiLens;

let nl = NotiLens::init("my-script", "YOUR_TOKEN", "YOUR_SECRET")?;
nl.notify("payment.received", "$299 from Stripe")?;
notilens init --name my-app --token YOUR_TOKEN --secret YOUR_SECRET
notilens notify report.ready "Daily report generated" --name my-app
That's it — no webhook server, no push certificates, no message queue. The notification arrives on your phone within seconds.
Optional

Optional parameters

notify(event, message, ...) only needs an event name and a message. Everything else is optional:

ParameterTypeDescription
levelstringSeverity — info, success, warning, urgent
open_urlURLOpens this URL when the notification is tapped
download_urlURLAttaches a downloadable file link
tagsstringComma-separated tags for filtering and organisation
is_actionablebooleanAdds interactive buttons (acknowledge, snooze) and repeats delivery until acknowledged

Notifications also support acknowledgement, snoozing, private notes, and shared comments directly in the NotiLens app — no extra code required.