Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

zerolong0/growthscope-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GrowthScope Web SDK

AI-first growth product. Tiny (2.3KB) browser SDK that pipes web events into a CLI-driven analytics platform — so a growth Agent (Claude, Cursor, your own scripts) can analyze your product alongside you, every day.

Part of the GrowthScope platform — Cursor 之于代码 = GrowthScope 之于增长.

npm License: MIT


🎯 What is this and who is it for

GrowthScope rethinks product analytics from the ground up for the AI agent era.

Old tools (Mixpanel / Amplitude / PostHog):

  • Dashboard-first → humans stare at charts → growth insight is bottlenecked by who has time to open the browser
  • SDKs are heavy, configured once, then forgotten

GrowthScope:

  • AI-first. All data is consumed via CLI / Skills / scripts — designed for Agents to operate, not humans to navigate
  • A growth Agent works alongside you. Ask Claude "为什么 signup → onboarding 这步转化降了?" → it queries via growth --json funnel ... → answers with data + suggests fixes
  • No dashboard. Just terminal + Agent + your code

This SDK is one piece: 2.3KB gzipped, runs in any browser, gets your events into the platform so the Agent has data to work with.


Install

npm install @growthscope/sdk-web
# or
pnpm add @growthscope/sdk-web

Usage

import { GrowthScope } from '@growthscope/sdk-web';

// 1. Configure once
GrowthScope.configure({
  appId: 'myapp-web',
  endpoint: 'https://myapp.com/api/growthscope/v1',
});

// 2. Track
GrowthScope.track('signup_start', { source: 'landing' });

// 3. Identify
GrowthScope.identify('user-123', { plan: 'free' });

// 4. Reset on logout
GrowthScope.reset();

Then ask Claude / Cursor:

"Look at signup_start → signup_complete funnel for myapp-web this week. What dropped?"

It runs growth --json funnel myapp-web signup_start signup_complete and answers with data.

What you get

  • 2.3KB gzipped — 20× lighter than PostHog SDK
  • localStorage queue — survives offline / nav
  • navigator.sendBeacon — events flush on unload (no lost data)
  • TypeScript declarations included
  • ESM + CJS dual build
  • No transitive dependencies

Privacy

  • ✅ No third-party network calls (only to your endpoint)
  • ✅ Privacy-mode safe (localStorage fail = fall back to in-memory session)
  • ✅ Caller controls all properties — no automatic PII collection

Architecture

Browser
  │
  ├── GrowthScope.track(...)
  │     │
  │     ├── enqueue → localStorage
  │     └── async POST → your endpoint
  │
  └── beforeunload / pagehide
        └── navigator.sendBeacon → flush remaining queue

Your server (GrowthScope side-car) → Postgres
  ↑
  └── Agent queries via CLI / Skills (NOT dashboards)

Sister projects

License

MIT © 2026 zerolong0

About

AI-first growth product — have a growth Agent analyzing your product alongside you. Part of GrowthScope.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors