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.
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.
1. Install
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.
3. Send your first notification
Initialise once with your credentials, then call notify() — that's the whole integration.
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
Optional parameters
notify(event, message, ...) only needs an event name and a message. Everything else is optional:
| Parameter | Type | Description |
|---|---|---|
level | string | Severity — info, success, warning, urgent |
open_url | URL | Opens this URL when the notification is tapped |
download_url | URL | Attaches a downloadable file link |
tags | string | Comma-separated tags for filtering and organisation |
is_actionable | boolean | Adds 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.
Where to go next
- SDK & CLI overview — task lifecycle tracking, metrics, and full language reference
- Webhooks — send notifications via plain HTTP from any system
- Integrations — connect Stripe, GitHub, Zapier, and more