{"id":50917801,"url":"https://github.com/nks-hub/rybbit-ts","last_synced_at":"2026-06-16T17:02:27.002Z","repository":{"id":336911164,"uuid":"1151619678","full_name":"nks-hub/rybbit-ts","owner":"nks-hub","description":"Privacy-first analytics SDK for TypeScript — typed GA4-compatible events, GTM bridge, event queuing, zero cookies. Wrapper for Rybbit Analytics with ESM, IIFE and script tag support.","archived":false,"fork":false,"pushed_at":"2026-04-26T22:41:38.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-27T00:24:04.792Z","etag":null,"topics":["analytics","cookieless","ecommerce","event-tracking","ga4","gdpr","google-tag-manager","gtm","npm","privacy","rybbit","sdk","typescript","web-analytics"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@nks-hub/rybbit","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nks-hub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-06T17:33:44.000Z","updated_at":"2026-04-26T22:41:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nks-hub/rybbit-ts","commit_stats":null,"previous_names":["lukyrys/nks-js-rybbit","nks-hub/rybbit-ts"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nks-hub/rybbit-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nks-hub%2Frybbit-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nks-hub%2Frybbit-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nks-hub%2Frybbit-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nks-hub%2Frybbit-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nks-hub","download_url":"https://codeload.github.com/nks-hub/rybbit-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nks-hub%2Frybbit-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34415248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","cookieless","ecommerce","event-tracking","ga4","gdpr","google-tag-manager","gtm","npm","privacy","rybbit","sdk","typescript","web-analytics"],"created_at":"2026-06-16T17:02:26.379Z","updated_at":"2026-06-16T17:02:26.993Z","avatar_url":"https://github.com/nks-hub.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @nks-hub/rybbit-ts\n\n[![Build Status](https://github.com/nks-hub/rybbit-ts/actions/workflows/build.yml/badge.svg)](https://github.com/nks-hub/rybbit-ts/actions)\n[![npm version](https://img.shields.io/npm/v/@nks-hub/rybbit-ts.svg)](https://www.npmjs.com/package/@nks-hub/rybbit-ts)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n\u003e Privacy-first analytics SDK for TypeScript - A modern wrapper for [Rybbit Analytics](https://rybbit.io) with typed events, GTM integration, and zero-configuration setup.\n\n---\n\n## Why Rybbit?\n\n**Privacy-first. Cookieless. No consent popups needed.**\n\nRybbit Analytics provides GDPR-compliant, cookieless tracking without requiring user consent dialogs. This SDK makes integration effortless with:\n\n- **Zero cookies** - No consent banners required\n- **TypeScript-first** - Fully typed GA4-compatible events\n- **GTM-ready** - Seamless Google Tag Manager bridge\n- **Queue management** - Never lose events during initialization\n- **Multiple loading strategies** - Works with any setup\n\n---\n\n## Quick Start\n\n### Installation\n\n```bash\nnpm install @nks-hub/rybbit-ts\n```\n\n### Usage\n\n#### ES Module\n\n```typescript\nimport nksRybbit from '@nks-hub/rybbit-ts';\n\n// Initialize SDK\nawait nksRybbit.boot({\n  host: 'https://demo.rybbit.com',\n  siteId: 'your-site-id'\n});\n\n// Track events\nnksRybbit.event('click_cta', { button: 'hero' });\n\n// E-commerce tracking\nnksRybbit.trackPurchase({\n  transactionId: 'TX-001',\n  value: 1299,\n  currency: 'CZK'\n});\n```\n\n#### Script Tag (IIFE)\n\n```html\n\u003cscript src=\"https://cdn.example.com/nks-rybbit.iife.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  NksRybbit.default.boot({\n    host: 'https://demo.rybbit.com',\n    siteId: 'your-site-id'\n  });\n\n  NksRybbit.default.event('page_view');\n\u003c/script\u003e\n```\n\n---\n\n## Features\n\n| Feature | Description |\n|---------|-------------|\n| **3 Loading Strategies** | Script injection, @rybbit/js SDK integration, or auto-detect |\n| **Event Queuing** | Buffers events before SDK ready, replays on initialization |\n| **Typed Events** | Full TypeScript support for GA4-compatible events (purchase, add_to_cart, view_item, etc.) |\n| **GTM Bridge** | Auto-forward Google Tag Manager dataLayer events to Rybbit |\n| **User Identification** | Automatic user ID extraction from server-rendered DOM |\n| **Dry-run Mode** | Test integration by logging events without sending |\n| **Session Replay** | Programmatic control over session recording |\n\n---\n\n## Bot Detection \u0026 E2E Testing\n\nSince Rybbit `v2.5` the analytics script ships an automatic client-side bot\nscore (`_bs`). The server silently drops events when it considers the request\na bot — including all of these patterns:\n\n- `navigator.webdriver === true` (Selenium / Playwright / Puppeteer default)\n- Headless Chrome (SwiftShader WebGL renderer, missing `window.chrome`, no plugins)\n- `outerWidth/outerHeight === 0`, `connection.rtt === 0`\n- Server-side: viewport `800×600` on a desktop User-Agent (Puppeteer default)\n\nThe SDK does not build payloads itself — the server-served `script.js` adds\n`_bs` automatically — so existing integrations stop seeing automated traffic\nwithout any code change.\n\n**For your own E2E tests**, set `dryRun: true` so the SDK never loads\n`script.js` and instead logs every call locally:\n\n```typescript\nawait nksRybbit.boot({\n  host: 'https://demo.rybbit.com',\n  siteId: 'your-site-id',\n  dryRun: process.env.NODE_ENV === 'test',\n});\n```\n\nWithout `dryRun`, your Playwright/Puppeteer test runs will be flagged as bots\nand silently dropped (the request still returns `200 OK` but with\n`message: \"bot detected\"` — no error surfaces in the browser).\n\n---\n\n## Documentation\n\nComprehensive guides to get you up and running:\n\n| Guide | Description |\n|-------|-------------|\n| [Getting Started](docs/getting-started.md) | Installation, configuration, and loading strategies |\n| [Events Reference](docs/events.md) | Complete catalog of typed events with examples |\n| [GTM Bridge](docs/gtm-bridge.md) | Google Tag Manager integration guide |\n| [API Reference](docs/api.md) | Full SDK API documentation |\n| [Examples](docs/examples.md) | Real-world integration examples |\n\n---\n\n## Build Outputs\n\n| File | Format | Size | Use Case |\n|------|--------|------|----------|\n| `dist/index.esm.js` | ESM | ~24 KB | Modern bundlers (Vite, webpack, Rollup) |\n| `dist/index.js` | CJS | ~25 KB | Node.js / require() imports |\n| `dist/index.iife.js` | IIFE | ~26 KB | Direct script tag (development) |\n| `dist/index.iife.min.js` | IIFE | ~13 KB | Direct script tag (production) |\n| `dist/index.d.ts` | Types | ~10 KB | TypeScript definitions |\n\n---\n\n## Configuration Example\n\n```typescript\nimport nksRybbit from '@nks-hub/rybbit-ts';\n\nawait nksRybbit.boot({\n  // Required\n  host: 'https://demo.rybbit.com',\n  siteId: 'your-site-id',\n\n  // Optional\n  loadStrategy: 'detect',             // 'detect' | 'script' | 'sdk'\n  debug: false,                       // Console logging\n  dryRun: false,                      // Test mode (log only)\n  gtmBridge: true,                    // Forward GTM events\n  gtmEvents: ['purchase'],            // Whitelist GTM events\n  autoIdentify: true,                 // Auto-detect user from DOM\n  globalProperties: { site: 'my-site' }\n});\n```\n\n---\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build SDK\nnpm run build\n\n# Type checking\nnpm run typecheck\n\n# Run tests\nnpm test\n\n# Watch mode\nnpm run dev\n```\n\n---\n\n## Requirements\n\n- **Node.js**: 16+ recommended\n- **TypeScript**: 5.0+ (for TypeScript projects)\n- **Browsers**: Modern browsers with ES6 support\n\n---\n\n## Contributing\n\nContributions are welcome! For major changes, please open an issue first.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'feat: description'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Support\n\n- 📧 **Email:** dev@nks-hub.cz\n- 🐛 **Bug reports:** [GitHub Issues](https://github.com/nks-hub/rybbit-ts/issues)\n- 🐸 **Rybbit Analytics:** [rybbit.io](https://rybbit.io)\n\n## License\n\nMIT License — see [LICENSE](LICENSE) for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ by \u003ca href=\"https://github.com/nks-hub\"\u003eNKS Hub\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnks-hub%2Frybbit-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnks-hub%2Frybbit-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnks-hub%2Frybbit-ts/lists"}