npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@notix-hub/sdk

v0.3.3

Published

JavaScript SDK for Notix (Нотикс) — notification aggregation service

Readme

@notix-hub/sdk

JavaScript SDK для Notix (Нотикс) — сервиса агрегации уведомлений.

Установка

npm

npm install @notix-hub/sdk
import { Notix } from '@notix-hub/sdk';

const notix = new Notix({ token: 'ntx_xxxxxxxxxx' });

await notix.notify({
  title: 'Новый заказ',
  body: 'Клиент оформил заказ на 12 000 ₽',
  type: 'order',
  priority: 'high',
});

CDN

<script src="https://notix-hub.ru/js/notify.js" data-token="ntx_..."></script>

Скрипт автоматически инициализирует window.notix и включает захват форм.

Без своего домена — через jsdelivr:

<script src="https://cdn.jsdelivr.net/npm/@notix-hub/sdk/dist/notify.min.js" data-token="ntx_..."></script>

API

new Notix(config)

| Параметр | Тип | По умолчанию | Описание | |----------|-----|-------------|----------| | token | string | — | API-токен (префикс ntx_) | | endpoint | string | https://notix-hub.ru/api/v1/webhook | URL вебхука | | autoCapture | boolean | true | Автозахват форм при создании | | timeout | number | 10000 | Таймаут запроса (мс) | | debug | boolean | false | Логирование в консоль | | metrika | MetrikaConfig | { enabled: auto } | Настройки Яндекс.Метрики |

notix.notify(payload)

Отправляет уведомление. Возвращает Promise<{ message, id }>.

| Поле | Тип | Обязательно | Описание | |------|-----|------------|----------| | title | string | Да | Заголовок | | body | string | Нет | Текст | | type | string | Нет | Slug типа уведомления (lead, order, message...) | | priority | string | Нет | low, normal, high, urgent | | payload | object | Нет | Произвольный JSON |

notix.capture(root?)

Вручную активирует захват форм. root — элемент, в котором искать формы (по умолчанию document).

notix.destroy()

Отключает захват форм.

Автозахват форм

Добавьте data-notify к форме, и SDK перехватит submit.

Шаблон (рекомендуется)

<form data-notify
      data-notify-type="lead"
      data-notify-tag="Сайт"
      data-notify-title="Новая заявка"
      data-notify-template="Имя: {name}\nТелефон: {phone}\nСообщение: {message}">
  <input name="name" placeholder="Ваше имя" required>
  <input name="phone" placeholder="Телефон">
  <textarea name="message" placeholder="Сообщение"></textarea>
  <button type="submit">Отправить</button>
</form>

Поля с метками

<form data-notify data-notify-title="Заявка">
  <input name="name" data-notify-label="Имя">
  <input name="phone" data-notify-label="Телефон">
  <button type="submit">Отправить</button>
</form>

Без шаблона и меток

SDK соберёт все поля как name: value.

Атрибуты:

| Атрибут | Описание | |---------|----------| | data-notify | Включает захват формы | | data-notify-title | Заголовок уведомления (по умолчанию document.title) | | data-notify-type | Тип уведомления (lead, order, message, crm, alert) | | data-notify-tag | Тег уведомления | | data-notify-priority | Приоритет (low, normal, high, urgent) | | data-notify-template | Шаблон тела с {field_name} | | data-notify-body | Статичный текст (если не нужен шаблон) | | data-notify-fields | Имена полей через запятую | | data-notify-label | Человекочитаемое название поля | | data-notify-field | Пометить конкретное поле |

Яндекс.Метрика

SDK автоматически определяет наличие window.ym и отправляет события:

  • notix_sent — уведомление отправлено
  • notix_error — ошибка отправки
  • notix_form_captured — захвачена форма

Отключить:

new Notix({ token: '...', metrika: { enabled: false } });

Разработка

npm install
npm run build    # сборка в dist/
npm run typecheck # проверка типов

Публикация

  1. Создать .env с токеном npm:

    NPM_TOKEN=npm_xxxxxxxxxxxxxxxxxxxx
  2. Опубликовать:

    source .env && npm publish --access public

После публикации пакет доступен:

  • npm: npm install @notix-hub/sdk
  • jsdelivr (CDN): https://cdn.jsdelivr.net/npm/@notix-hub/sdk/dist/notify.min.js

Лицензия

MIT