Skip to content

Commit 25ea963

Browse files
feat: add @posthog/convex package (#3077)
* chore: move progress from posthog-convex repo * Switch from vitest to jest * fix readme link * add changeset * Potential fix for code scanning alert no. 2135: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * fix(convex): stabilize example tests in CI * fix(react-native): declare missing babel preset-react * Revert "fix(react-native): declare missing babel preset-react" This reverts commit 9fe9473. The change was a fix for a broken test from a different PR, not needed here. * refactor(convex): move example app to examples/example-convex Move the Convex example from packages/convex/example/ to the top-level examples/ directory for consistency with other SDK examples. - Create standalone package.json with own dependencies - Exclude test files from convex tsconfig (Convex dev typecheck) - Update jest config roots and moduleNameMapper to resolve @posthog/convex from workspace source for integration tests - Update convex.json functions path - Remove example-only devDeps from package (chokidar-cli, react, etc.) * fix(react-native): declare @babel/preset-react as devDependency The react-native package uses @babel/preset-react in its babel config but never declared it explicitly. Also add typescript to convex package's devDependencies via catalog to prevent lockfile version drift from cascading to unrelated packages. * chore(convex): address PR review feedback - Remove unnecessary client/_generated directory (convex-test finds component/_generated) - Remove placeholder lib.test.ts - Use pnpm instead of npm in README install instructions * fix: regenerate lockfile from main to resolve babel side effects Reset pnpm-lock.yaml to main and regenerated with only the convex package dependencies on top, eliminating hoisting changes that were causing posthog-js-lite build failures on Vercel. * fix: declare babel presets as explicit devDependencies Add @babel/preset-env and @babel/preset-typescript to packages that reference them in babel.config but never declared them. These were resolving via hoisting, which broke when the dependency tree changed. --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent a1c2df9 commit 25ea963

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+7677
-70
lines changed

.changeset/cold-dogs-allow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@posthog/convex': minor
3+
---
4+
5+
Initial release of @posthog/convex - PostHog analytics integration for Convex

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ _Please describe._
2323
- [ ] posthog-react-native
2424
- [ ] @posthog/react
2525
- [ ] @posthog/ai
26+
- [ ] @posthog/convex
2627
- [ ] @posthog/nextjs-config
2728
- [ ] @posthog/nuxt
2829
- [ ] @posthog/rollup-plugin

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ _Please describe._
2121
- [ ] posthog-react-native
2222
- [ ] @posthog/react
2323
- [ ] @posthog/ai
24+
- [ ] @posthog/convex
2425
- [ ] @posthog/nextjs-config
2526
- [ ] @posthog/nuxt
2627
- [ ] @posthog/rollup-plugin

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [ ] posthog-react-native
2020
- [ ] @posthog/react
2121
- [ ] @posthog/ai
22+
- [ ] @posthog/convex
2223
- [ ] @posthog/nextjs-config
2324
- [ ] @posthog/nuxt
2425
- [ ] @posthog/rollup-plugin

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ jobs:
195195
- name: '@posthog/core'
196196
- name: '@posthog/react'
197197
- name: '@posthog/ai'
198+
- name: '@posthog/convex'
198199
- name: '@posthog/nextjs-config'
199200
- name: '@posthog/nuxt'
200201
- name: '@posthog/rollup-plugin'

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The repository contains the following SDK packages in `./packages/`:
3030
| `browser/` | `posthog-js` | Main browser SDK for capturing events and usage |
3131
| `web/` | `posthog-js-lite` | Lightweight browser SDK |
3232
| `ai/` | `@posthog/ai` | AI integrations for Node.js |
33+
| `convex/` | `@posthog/convex` | Convex.dev component |
3334
| `node/` | `posthog-node` | Node.js backend SDK (requires Node >= 20) |
3435
| `react/` | `@posthog/react` | React components and hooks |
3536
| `react-native/` | `posthog-react-native` | React Native mobile SDK |

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ PostHog JS is a mono-repo. The changelogs are in the individual packages
88
- [posthog-react-native](./packages/react-native/CHANGELOG.md)
99
- [@posthog/react](./packages/react/CHANGELOG.md)
1010
- [@posthog/ai](./packages/ai/CHANGELOG.md)
11+
- [@posthog/convex](./packages/convex/CHANGELOG.md)
1112
- [@posthog/nextjs-config](./packages/nextjs-config/CHANGELOG.md)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This is a monorepo containing multiple packages to integrate with Posthog using
2424
- [posthog-react-native](./packages/react-native/README.md)
2525
- [@posthog/react](./packages/react/README.md)
2626
- [@posthog/ai](./packages/ai/README.md)
27+
- [@posthog/convex](./packages/convex/README.md)
2728
- [@posthog/nextjs-config](./packages/nextjs-config/README.md)
2829
- [@posthog/nuxt](./packages/nuxt/README.md)
2930
- [@posthog/rollup-plugin](./packages/rollup-plugin/README.md)

bin/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ PACKAGES=(
4444
# Package display names for the menu
4545
declare -A PACKAGE_NAMES=(
4646
["ai"]="@posthog/ai"
47+
["convex"]="@posthog/convex"
4748
["browser"]="posthog-js"
4849
["core"]="@posthog/core"
4950
["nextjs-config"]="@posthog/nextjs-config"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Convex deployment (set automatically by `npx convex dev`)
2+
CONVEX_DEPLOYMENT=
3+
VITE_CONVEX_URL=
4+
5+
# PostHog (set these on your Convex deployment via `npx convex env set`)
6+
# npx convex env set POSTHOG_API_KEY phc_your_project_api_key
7+
# npx convex env set POSTHOG_HOST https://us.i.posthog.com

0 commit comments

Comments
 (0)