Skip to content

capture creation and deletion events#2363

Merged
lunika merged 15 commits into
mainfrom
backend/capture_event
Jun 1, 2026
Merged

capture creation and deletion events#2363
lunika merged 15 commits into
mainfrom
backend/capture_event

Conversation

@lunika
Copy link
Copy Markdown
Member

@lunika lunika commented May 28, 2026

Purpose

We want to capture some events in the backend application. We are starting with capturing when a document is created or deleted. For this we use the PostHog SDK, and we created a dedicated helper.

Proposal

  • ♻️(backend) split posthog configuration
  • ♻️(frontend) split posthog conf and how sdl is initialized
  • 📈(backend) create a utils to capture event with posthog
  • 📈(backend) capture an event when a document is created and deleted

@lunika lunika requested a review from AntoLC May 28, 2026 12:59
@lunika lunika self-assigned this May 28, 2026
@lunika lunika added enhancement improve an existing feature backend labels May 28, 2026
@lunika lunika changed the title capture creating and deletion events capture creation and deletion events May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Size Change: 0 B

Total Size: 4.32 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/901196a0/_buildManifest.js 653 B +653 B (new file) 🆕
apps/impress/out/_next/static/d8d01d83/_buildManifest.js 0 B -653 B (removed) 🏆

compressed-size-action

The posthog information were only available using the POSTHOG_KEY
settings. We split it in POSTHOG_KEY and POSTHOG_HOST to use them with
the pyhton posthog sdk
@lunika lunika force-pushed the backend/capture_event branch from 5953104 to 8c3c99b Compare June 1, 2026 15:11
Reflect the changes made about posthog by the backend application. The
posthog config is split in POSTHOG_KEY and POSTHOG_HOST properties.
@lunika lunika force-pushed the backend/capture_event branch from 8c3c99b to e10f9b3 Compare June 1, 2026 15:12
lunika added 13 commits June 1, 2026 17:41
We want to capture event with posthog. We created a utils for this
reposible to send the event or not if posthog is configured.
When a document is created and deleted, we capture an event and we send
it to posthog.
We want to capture an event every time a user logs in.
We want to capture an event when a document is duplicated. The document
from where come from the duplication is added in the properties.
We want to capture an event when a file is imported. We add in the
properties the type of file imported and if it is in the
create-for-owner api call.
We want to capture an event when a user flag a document as a favorite.
When an AI action is called from ai_translate, ai_transform and
ai_proxy, an event doc_ai_action is captured with a method property
giving the information from where it is called.
When an access is created we want to capture an event.
When an access is deleted we want to capture an event.
When a new thread is created, we capture an event related to this thread
creation.
When a new comment is created, we capture an event related to this comment
creation.
When a document is moved we want to capture an event. The position and
target_document_id is added to the sent properties.
When a user leave a document, we want to capture an event.
@lunika lunika force-pushed the backend/capture_event branch from e10f9b3 to 1ebc8d5 Compare June 1, 2026 15:48
@lunika lunika merged commit 1ebc8d5 into main Jun 1, 2026
44 of 45 checks passed
@lunika lunika deleted the backend/capture_event branch June 1, 2026 16:38
@AntoLC AntoLC mentioned this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend enhancement improve an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants