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

@teleforgex/core

v0.1.0

Published

Foundation package for Teleforge: manifest, validation, and events.

Readme

@teleforgex/core

Core manifest schema, validation, and loading utilities for Teleforge.

Installation

npm install @teleforgex/core

Exports

import {
  EventTypes,
  parseLaunchContext,
  createEventBus,
  loadManifest,
  manifestSchema,
  validateInitDataBotToken,
  validateInitDataEd25519,
  validateManifest
} from "@teleforgex/core";

@teleforgex/core validates the current Teleforge manifest shape emitted by the generator and consumed by devtools.

It also exposes launch parsing and server-side initData validation helpers for Telegram Mini Apps:

const result = validateInitDataBotToken(initData, process.env.BOT_TOKEN ?? "");

if (result.valid) {
  console.log(result.data.user?.id);
}

Third-party validation is also available through Telegram's Ed25519 signature flow. This path requires the bot ID and Telegram's environment public key, and uses the current signature field from initData:

const result = await validateInitDataEd25519(initData, telegramPublicKeyHex, {
  botId: 12345678,
  maxAge: 3600
});

This follows Telegram's current third-party validation format: signature is base64url-encoded, the public key is hex, and the signed payload is prefixed with ${botId}:WebAppData before the sorted key=value lines.

For cross-surface messaging, @teleforgex/core now includes a shared event bus:

const bus = createEventBus();

bus.on(EventTypes.ORDER_CREATED, (event) => {
  console.log(event.payload);
});

React helpers are available from the isolated @teleforgex/core/react subpath so Node consumers do not pull React transitively:

import { useEvent, useEventBus, useEventPublisher } from "@teleforgex/core/react";

Browser-focused consumers can avoid the Node-only manifest and HMAC helpers by importing from the browser-safe subpath:

import { parseLaunchContext } from "@teleforgex/core/browser";

Validation Runtimes

  • validateInitDataEd25519() uses WebCrypto and is intended to work anywhere globalThis.crypto.subtle supports Ed25519, including modern browsers and edge-style runtimes.
  • validateInitDataBotToken() is Node-only because it relies on node:crypto HMAC helpers and a bot token that should stay server-side.
  • Teleforge BFF prefers Ed25519 when publicKey + botId are configured. If only botToken is configured in a non-Node runtime, the BFF throws RUNTIME_UNSUPPORTED_VALIDATION rather than silently skipping validation.

Flow State Contract

UserFlowState is the canonical V1 continuity contract exported by @teleforgex/core:

interface UserFlowState {
  flowId: string;
  userId: string;
  stepId: string;
  payload: Record<string, unknown>;
  createdAt: number;
  expiresAt: number;
  version: number;
  chatId?: string;
}

If you are reconciling older planning artifacts, stepId is the active step identifier and payload holds the resumable flow context.

Teleforge V1 intentionally keeps this contract minimal. The runtime does not yet persist richer continuity fields such as currentSurface, resumable, updatedAt, summary, pendingAction, returnRoute, or history. Treat those as future contract extensions rather than part of the current storage API.