Getting Started

Notilux lets you send iPhone notifications from your backend without building or maintaining a mobile app.

How it works

1. Create an account

Register at Notilux and grab your credentials from the dashboard.

NOTILUX_CLIENT_ID=your_client_id
NOTILUX_CLIENT_SECRET=your_client_secret

2. Install the SDK

npm i notilux

By default the SDK reads NOTILUX_CLIENT_ID and NOTILUX_CLIENT_SECRET from your environment.

import { Notilux } from 'notilux'

export const notilux = new Notilux()

You can also pass credentials explicitly.

export const notilux = new Notilux({ clientId: '...', clientSecret: '...' })

3. Pair a device

Generate a pairing link and share it with the user. Opening it on their iPhone will prompt them to install the companion app if needed, then pair the device with your project.

const url = await notilux.getPairingLink(user_id)

You can use any stable identifier as the external reference. A user ID, an email, whatever makes sense for your app.

Note: Links expire after one hour. For a permanent entry point, create a server-side endpoint (e.g. /pair-device) that generates a fresh link and redirects the user. Avoid client-side javascript redirects as Safari blocks them for security reasons.

Example React Router v7

// React component
export const PairButton = () => {
  return <a href="/pair-device">Install notifications</a>
}
// /app/routes/api/pair-device.tsx
export async function loader() {
  const user_id = 'xxx' // Depends on your app requirements

  const url = await notilux.getPairingLink(user_id) // Fresh link on each click

  return redirect(url) // Redirection works on Safari and Chrome
}

4. Send notifications

notilux.send({
  user_id,
  title: 'New signup',
  body: `${user_email} just joined`,
})

More