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

combox-api

v0.1.2

Published

TypeScript client library for ComBox frontend applications.

Readme

ComBox API SDK

Code Quality Socket Badge

English | Русский

TypeScript client library для фронтендов ComBox. Она оборачивает backend HTTP endpoints, auth/session storage, realtime helpers, normalized model helpers и message-content utilities.

Что умеет

  • register / login / refresh / logout
  • profile, password, email change, profile settings
  • chats, messages, reactions, channels/topics
  • media attachments и sessions
  • GIF integration helpers
  • bot tokens и bot webhooks
  • presence helpers
  • локальное хранение auth/profile
  • WebSocket/realtime helpers
  • normalized message/profile helpers

Поверхность пакета

Основные exports:

  • comboxApi.ts - functional API
  • client.ts - class wrapper ComboxClient
  • realtime.ts - realtime helpers
  • messageContent.ts - content parsing/formatting helpers
  • normalized.ts - normalization utilities
  • storage.ts - local storage helpers
  • comboxApi.types.ts - общие публичные типы

Точка входа:

import { ComboxClient, login, getProfile, connectRealtime } from 'combox-api'

Сборка

npm install
npm run build

Скрипты

  • npm run check - TypeScript-проверка без генерации файлов
  • npm run build - компиляция TypeScript в dist/
  • npm run prepare - сборка на package prepare

Runtime-поведение

По умолчанию пакет выводит URL из browser environment:

  • API base по умолчанию /api/private/v1
  • WS base по умолчанию вычисляется из browser websocket endpoint

Поддерживаемые env overrides:

  • VITE_API_BASE_URL
  • VITE_WS_BASE_URL

Основные концепции

Functional API

Можно использовать прямые функции:

login register getProfile updateProfile listChats listMessages createMessage

ComboxClient

ComboxClient даёт объектную обёртку над тем же API. Это удобно, когда приложению нужен один client instance вместо множества импортируемых функций.

Auth persistence

Пакет хранит:

  • auth snapshot в local storage
  • local profile snapshot для удобства фронтенда

Есть helpers:

  • getCurrentUser()
  • getAccessToken()
  • isAuthenticated()
  • forceRefreshSession()
  • clearAuth()

Структура проекта

  • src/index.ts - export surface пакета
  • src/comboxApi.ts - основной functional API
  • src/client.ts - ComboxClient
  • src/realtime.ts - realtime transport helpers
  • src/messageContent.ts - parsing содержимого сообщений
  • src/normalized.ts - normalization helpers
  • src/storage.ts - storage helpers
  • src/comboxApi.types.ts - публичные типы

Выход сборки

Артефакты сборки пишутся в:

  • dist/index.js
  • dist/index.d.ts

Пакет экспортирует только dist/.

Заметки

  • пакет ориентирован на browser runtime
  • он предполагает наличие window, localStorage, fetch и браузерной семантики WebSocket, где это нужно
  • class API и functional API должны оставаться совместимыми по контракту

Релизы

  • публикация автоматизирована через release.yml
  • создай GitHub Release с тегом vX.Y.Z, который совпадает с версией в package.json
  • обычные релизы публикуются в npm с тегом latest
  • prerelease публикуются в npm с тегом next
  • в репозитории должен быть secret NPM_TOKEN с правом публикации пакета

Лицензия

Авторы

Ernela — разработчица;
D7TUN6 — идея, разработчик