Docs / Getting Started

Installation

Package managers

npm
npm install @ambersecurityinc/notifly
pnpm
pnpm add @ambersecurityinc/notifly
yarn
yarn add @ambersecurityinc/notifly
bun
bun add @ambersecurityinc/notifly

Runtime requirements

notifly uses only the Web APIfetch, URL, and Promise. There are no Node.js built-ins (http, net, fs, etc.). This means it works in any environment that supports the Web API:

Runtime Minimum version Notes
Node.js 18.0.0 Native fetch available since Node 18
Bun Any Full Web API support
Deno Any Full Web API support. Use npm: specifier
Cloudflare Workers Any See the CF Workers guide

TypeScript

notifly is written in TypeScript. Types are included in the package — no @types/* package needed.

types
import type {
  NotiflyMessage,
  NotiflyResult,
  NotiflyOptions,
  ServiceConfig,
  ServiceDefinition,
  ParseError,
  ServiceError,
} from '@ambersecurityinc/notifly';

ESM and CJS

The package ships both ESM (.js) and CommonJS (.cjs) builds with matching type declarations. Your bundler or runtime picks the correct format automatically via the exports field in package.json.

import styles
// ESM (default — recommended)
import { notify } from '@ambersecurityinc/notifly';

// CommonJS
const { notify } = require('@ambersecurityinc/notifly');

Builder sub-export

The headless URL builder is exported from a separate entry point to keep bundle sizes small when you only need the builder (e.g. in a config UI):

builder import
import {
  getServiceSchemas,
  validateFields,
  buildUrl,
  smartParse,
} from '@ambersecurityinc/notifly/builder';

Bundle size

The main notify entry point is small — each service adapter is tree-shakeable. The builder sub-export is independent and can be included in UI bundles without pulling in the network dispatch code.

Tip: If you're using Cloudflare Workers, check the Cloudflare Workers guide for an example wrangler.toml setup and environment variable handling.

← Previous Quick Start Next → API Reference