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

@tinycrm/sdk

v1.2.0

Published

Sync your customers to TinyCRM

Downloads

383

Readme

@tinycrm/sdk

Sync your customers to TinyCRM — see every customer across all your projects in one filterable table, merged by email.

  • Zero dependencies
  • < 2 kB gzipped
  • Works anywhere — Node.js, Edge, serverless, or the browser (uses native fetch)

Install

npm install @tinycrm/sdk

Quick Start

import { TinyCRM } from "@tinycrm/sdk";

const crm = new TinyCRM("tcrm_proj_your_api_key");

// Identify a customer
await crm.identify({
  email: "[email protected]",
  name: "Alice Smith",
  status: "paid",
  params: { plan: "pro", source: "product-hunt" },
});

// Track an event
await crm.track("[email protected]", "subscription_created", {
  plan: "pro",
  interval: "monthly",
});

// Update last activity
await crm.ping("[email protected]");

API

new TinyCRM(apiKey)

Create a new client. Pass your project API key as a string or a config object.

// String shorthand
const crm = new TinyCRM("tcrm_proj_...");

// Config object
const crm = new TinyCRM({ apiKey: "tcrm_proj_..." });

crm.identify(payload)

Identifies a customer and syncs them to TinyCRM. If a customer with the same email already exists, their record is updated.

| Field | Type | Required | Description | | -------- | ------------------------------------------ | -------- | ------------------------------------ | | email | string | Yes | Customer email (merge key) | | name | string | No | Customer name | | status | "free" \| "paid" | No | Customer status for this project | | params | Record<string, string \| number \| boolean> | No | Custom key-value data |

await crm.identify({
  email: "[email protected]",
  name: "Alice Smith",
  status: "paid",
  params: { plan: "pro", role: "admin" },
});

crm.track(email, event, properties?)

Tracks a custom event for a customer. The customer must already exist (call identify() first). Events appear in the customer's activity timeline in TinyCRM.

| Field | Type | Required | Description | | ------------ | ------------------------------------------ | -------- | ------------------------------------ | | email | string | Yes | Customer email | | event | string | Yes | Event name (max 128 chars) | | properties | Record<string, string \| number \| boolean> | No | Event properties (max 20 keys) |

await crm.track("[email protected]", "subscription_created", {
  plan: "pro",
  interval: "monthly",
});

await crm.track("[email protected]", "feature_used", {
  feature: "csv-import",
  count: 3,
});

crm.ping(email)

Updates the last_activity timestamp for a customer. Call this on meaningful user actions to keep activity data fresh.

await crm.ping("[email protected]");

Types

The SDK exports TypeScript types for all payloads:

import type { IdentifyPayload, TrackEventPayload, TinyCRMConfig } from "@tinycrm/sdk";

Error Handling

Errors are logged to console.error with a [tinycrm] prefix and never thrown, so the SDK won't break your app.

React Feedback Widget

The @tinycrm/sdk/react subpath ships a drop-in <FeedbackWidget> — a floating button that opens a modal where your users can send feedback (with an optional screenshot of the current page). Submissions land in your TinyCRM feedback inbox.

Add it once to your root layout:

"use client";
import { FeedbackWidget } from "@tinycrm/sdk/react";

export function Feedback() {
  return (
    <FeedbackWidget
      apiKey="tcrm_proj_..."
      projectId="your-project-id"
      email="[email protected]" // optional: who is sending
    />
  );
}

Props

| Prop | Type | Default | Description | | ------------- | ------------------------------------------ | ---------------- | ------------------------------------------------------ | | apiKey | string | — | Project API key (tcrm_proj_...), sent as Bearer. | | projectId | string | — | Project the feedback belongs to. | | email | string | — | Identifies the end-user submitting feedback. | | name | string | — | Display name for the end-user. | | metadata | Record<string, string \| number \| boolean> | — | Arbitrary metadata (max 20 keys). | | position | "bottom-right" \| "bottom-left" | "bottom-right" | Corner the floating button is pinned to. | | theme | "light" \| "dark" \| "auto" | "auto" | auto follows the user's OS color scheme. | | accentColor | string | — | Shorthand to set the brand accent color. | | colors | FeedbackWidgetColors | — | Fine-grained color overrides (see below). | | categories | FeedbackCategoryOption[] | Bug/Idea/Other | Override the category options. | | baseUrl | string | hosted API | Point at a custom API base URL. | | debug | boolean | false | Log network/runtime errors to the console. |

Theming

Light and dark themes are built in. Set theme explicitly, or leave it on "auto" to follow the OS. To match your brand, pass accentColor or the full colors object — each value is applied as a CSS variable, so any CSS color works:

<FeedbackWidget
  apiKey="tcrm_proj_..."
  projectId="your-project-id"
  theme="dark"
  accentColor="#6366f1"
  colors={{ background: "#0b0b12", border: "#27272a" }}
/>

The widget depends on react/react-dom (≥18, as peer deps). Screenshots are captured with html2canvas-pro, which supports modern CSS color functions (oklch, lab, color-mix) so capture works in Tailwind v4 apps. The server entry (@tinycrm/sdk) stays dependency-free.

License

MIT