mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat(analytics): build-time bake + telemetry depth (#336)
Bake PostHog + Sentry into the published Docker image (SNAPOTTER_ANALYTICS build arg, codegen script). Delete entire consent system. Move event emission to BullMQ worker. Add cross-tier identity stitching, Sentry performance tracing on both tiers, frontend funnel events. Fix stateful regex bug. 86 files changed, 1593 insertions(+), 3747 deletions(-)
This commit is contained in:
@@ -7,26 +7,6 @@ export async function login(page: Page, username = "admin", password = "admin")
|
||||
await page.getByRole("button", { name: /login/i }).click();
|
||||
}
|
||||
|
||||
export async function getSessionViaApi(page: Page) {
|
||||
const token = await page.evaluate(() => localStorage.getItem("snapotter-token") ?? "");
|
||||
const res = await page.request.get("/api/auth/session", {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function setConsentViaApi(
|
||||
page: Page,
|
||||
data: { enabled?: boolean; remindLater?: boolean },
|
||||
) {
|
||||
const token = await page.evaluate(() => localStorage.getItem("snapotter-token") ?? "");
|
||||
const apiBase = process.env.API_URL || "http://localhost:13491";
|
||||
await page.request.put(`${apiBase}/api/v1/user/analytics`, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export const test = base.extend<{ loggedInPage: Page }>({
|
||||
loggedInPage: async ({ page }, use) => {
|
||||
await page.goto("/");
|
||||
|
||||
Reference in New Issue
Block a user