Skip to content

Conversation

@lindesvard
Copy link
Contributor

@lindesvard lindesvard commented Nov 19, 2025

Summary by CodeRabbit

  • New Features

    • Added user identification capabilities to link anonymous events to specific users.
    • Introduced ad blocker mitigation strategies with proxy-based solutions for WordPress, Next.js, and custom frameworks.
    • Enhanced event tracking with data attribute support for automatic click tracking.
  • Documentation

    • Expanded getting started guides covering SDK installation, event tracking, user identification, and revenue tracking.
    • Added comprehensive analytics documentation explaining device IDs, sessions, profiles, and timestamp handling.
    • Restructured main documentation with quick-start flow and key features overview.
    • Added new SDKs documentation section.
  • Chores

    • Version bumps across SDKs and dependencies.
    • TypeScript configuration standardization.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Nov 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
openpanel-public Error Error Nov 19, 2025 8:56pm

@lindesvard lindesvard merged commit 83e223a into main Nov 19, 2025
6 of 9 checks passed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR implements a Proxy-based window.op initialization pattern across multiple SDKs, adds comprehensive tracking and onboarding documentation, bumps SDK versions, consolidates TypeScript configurations to a unified SDK schema, and refines the web SDK's type system with new API shapes and validation tests.

Changes

Cohort / File(s) Summary
Proxy-based window.op Implementation
apps/public/content/articles/cookieless-analytics.mdx, apps/public/content/docs/(tracking)/sdks/script.mdx, apps/public/content/docs/self-hosting/self-hosting.mdx, apps/start/src/components/onboarding/connect-web.tsx
Replace simple function-based window.op initialization with Proxy-based queue capture, enabling dynamic method interception and property access handling
Tracking Documentation
apps/public/content/docs/(tracking)/*
Add new docs pages: adblockers mitigation guide, how-it-works core concepts (device ID, session, profile ID, timestamps), and SDKs navigation structure via meta.json
Get-Started Onboarding
apps/public/content/docs/get-started/*
Introduce quick-start flow with install-openpanel, track-events, identify-users, and revenue-tracking guides; add meta.json navigation config
Documentation Index Restructure
apps/public/content/docs/index.mdx, apps/public/content/docs/meta.json
Rewrite main docs landing page from tutorial-style to features-first layout with key features table and quick-start cards; add docs-level navigation meta.json; remove legacy SDKs nav at old location
Web SDK Core Updates
packages/sdks/web/src/init-snippet.ts, packages/sdks/web/src/tracker.ts, packages/sdks/web/src/types.d.ts, packages/sdks/web/src/types.debug.ts, packages/sdks/web/index.ts
Add getInitSnippet export and function; refactor tracker.ts to Proxy-based opCallable with dual callable/property access; introduce OpenPanelAPI composite type and type validation test suite
Web SDK Version & Dependencies
packages/sdks/web/package.json
Bump version 1.0.2 → 1.0.3 and @openpanel/sdk 1.0.0 → 1.0.1
Next.js SDK Integration
packages/sdks/nextjs/index.tsx, packages/sdks/nextjs/package.json, packages/sdks/nextjs/tsconfig.json
Import and use getInitSnippet; update version 1.0.15 → 1.0.16 and @openpanel/web 1.0.2 → 1.0.3; change tsconfig extends to sdk.json
Astro SDK Integration
packages/sdks/astro/package.json, packages/sdks/astro/src/OpenPanelComponent.astro
Import getInitSnippet and integrate into template; update version 1.0.2 → 1.0.3 and @openpanel/web dependency
SDK TypeScript Config Standardization
packages/sdks/express/tsconfig.json, packages/sdks/react-native/tsconfig.json, packages/sdks/sdk/tsconfig.json
Unify tsconfig extends from @openpanel/tsconfig/base.json to @openpanel/tsconfig/sdk.json
Express SDK Updates
packages/sdks/express/package.json
Bump version 1.0.1 → 1.0.2 and @openpanel/sdk 1.0.0 → 1.0.1
React Native SDK Updates
packages/sdks/react-native/package.json, packages/sdks/react-native/tsconfig.json
Update version 1.0.1 → 1.0.2, @openpanel/sdk dependency, add tsup and typescript devDeps; update tsconfig extends
SDK Base Package
packages/sdks/sdk/package.json
Bump version 1.0.0 → 1.0.1
TypeScript Config Tooling
tooling/typescript/sdk.json
Add new strict TypeScript SDK configuration template with ES2020 target, DOM/ESNext libraries, and bundler module resolution
Build Tooling Updates
apps/public/public/op1.js
Rename local loop variables in resolveHeaders and method parameters; downgrade default SDK version 1.0.2 → 1.0.1
Publish Configuration
tooling/publish/publish.ts
Update module field in release package.json from ./dist/index.mjs to ./dist/index.js

Sequence Diagram(s)

sequenceDiagram
    participant App as App/Page
    participant Proxy as window.op<br/>(Proxy Handler)
    participant Queue as Internal Queue<br/>(Array)
    
    App->>Proxy: window.op('track', 'click')
    activate Proxy
    Proxy->>Queue: Push ['track', 'click']
    deactivate Proxy
    
    App->>Proxy: window.op.q
    activate Proxy
    Note over Proxy: get trap: "q" property
    Proxy-->>App: Return Queue array
    deactivate Proxy
    
    App->>Proxy: window.op.identify({ id: '123' })
    activate Proxy
    Note over Proxy: get trap: retrieve bound function
    Proxy->>Queue: Push ['identify', { id: '123' }]
    deactivate Proxy
Loading
sequenceDiagram
    participant SDK as Framework SDK<br/>(Next.js/Astro)
    participant getInitSnippet as getInitSnippet()<br/>Function
    participant Script as Script Output
    
    SDK->>getInitSnippet: Call getInitSnippet()
    activate getInitSnippet
    getInitSnippet-->>SDK: Return minified Proxy init code
    deactivate getInitSnippet
    
    SDK->>Script: Prepend snippet + method bindings
    activate Script
    Note over Script: Combine init snippet with<br/>SDK-specific method setup
    Script-->>SDK: Complete inline script
    deactivate Script
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Type system overhaul (packages/sdks/web/src/types.d.ts): Introduction of OpenPanelAPI, OpenPanelMethodSignatures, and refinement of ExposedMethodsNames requires careful validation of overload correctness and backward compatibility
  • Proxy-based implementation (packages/sdks/web/src/tracker.ts): The refactoring from simple dispatch to Proxy-based callable with property access trapping has behavioral implications; verify both callable and property-based access patterns work correctly
  • Cross-SDK coordination: getInitSnippet integration across multiple SDKs (Next.js, Astro) needs verification that the minified snippet behaves identically to the previous inline implementations
  • Documentation consistency: Multiple MDX files and meta.json additions should be audited for completeness, accuracy, and navigation structure alignment
  • Version cascade: Verify SDK version bumps and dependency chains are consistent and correctly propagate through the monorepo

Possibly related PRs

  • Feature/revenue 2 #237: Extends the web SDK public API surface with revenue-related methods (packages/sdks/web/src/types.d.ts modifications), complementing this PR's type system consolidation and API shape changes for window.op.

Poem

🐰 A proxy-based hop through the SDK!
Queues captured, types refined, no track is back—
Snippets reused across frameworks aligned,
Window.op bounces with methods redesigned,
Documentation blooms as we start the quick track!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/sdks-and-docs

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 790801b and f30d74f.

📒 Files selected for processing (36)
  • apps/public/content/articles/cookieless-analytics.mdx (1 hunks)
  • apps/public/content/docs/(tracking)/adblockers.mdx (1 hunks)
  • apps/public/content/docs/(tracking)/how-it-works.mdx (1 hunks)
  • apps/public/content/docs/(tracking)/meta.json (1 hunks)
  • apps/public/content/docs/(tracking)/sdks/meta.json (1 hunks)
  • apps/public/content/docs/(tracking)/sdks/script.mdx (1 hunks)
  • apps/public/content/docs/get-started/identify-users.mdx (1 hunks)
  • apps/public/content/docs/get-started/install-openpanel.mdx (1 hunks)
  • apps/public/content/docs/get-started/meta.json (1 hunks)
  • apps/public/content/docs/get-started/track-events.mdx (1 hunks)
  • apps/public/content/docs/index.mdx (1 hunks)
  • apps/public/content/docs/meta.json (1 hunks)
  • apps/public/content/docs/sdks/meta.json (0 hunks)
  • apps/public/content/docs/self-hosting/self-hosting.mdx (1 hunks)
  • apps/public/public/op1.js (1 hunks)
  • apps/start/src/components/onboarding/connect-web.tsx (1 hunks)
  • packages/sdks/astro/package.json (2 hunks)
  • packages/sdks/astro/src/OpenPanelComponent.astro (3 hunks)
  • packages/sdks/express/package.json (1 hunks)
  • packages/sdks/express/tsconfig.json (1 hunks)
  • packages/sdks/nextjs/index.tsx (2 hunks)
  • packages/sdks/nextjs/package.json (1 hunks)
  • packages/sdks/nextjs/tsconfig.json (1 hunks)
  • packages/sdks/react-native/package.json (1 hunks)
  • packages/sdks/react-native/tsconfig.json (1 hunks)
  • packages/sdks/sdk/package.json (1 hunks)
  • packages/sdks/sdk/tsconfig.json (1 hunks)
  • packages/sdks/web/index.ts (1 hunks)
  • packages/sdks/web/package.json (1 hunks)
  • packages/sdks/web/src/init-snippet.ts (1 hunks)
  • packages/sdks/web/src/tracker.ts (2 hunks)
  • packages/sdks/web/src/types.d.ts (2 hunks)
  • packages/sdks/web/src/types.debug.ts (1 hunks)
  • packages/sdks/web/tsconfig.json (1 hunks)
  • tooling/publish/publish.ts (1 hunks)
  • tooling/typescript/sdk.json (1 hunks)

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lindesvard lindesvard deleted the feature/sdks-and-docs branch November 22, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants