mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-14 10:09:33 -06:00
Add jsVersion & sessionCreated event to Telemetry (#720)
This commit is contained in:
@@ -3,6 +3,7 @@ import { trackAction } from "./actions";
|
||||
import { Config } from "./config";
|
||||
import { NetworkError, Result, err, ok } from "./errors";
|
||||
import { Logger } from "./logger";
|
||||
import packageJson from "../../package.json";
|
||||
|
||||
const config = Config.getInstance();
|
||||
const logger = Logger.getInstance();
|
||||
@@ -19,6 +20,7 @@ const syncWithBackend = async (): Promise<Result<TJsState, NetworkError>> => {
|
||||
environmentId: config.get().environmentId,
|
||||
personId: config.get().state?.person.id,
|
||||
sessionId: config.get().state?.session.id,
|
||||
jsVersion: packageJson.version,
|
||||
}),
|
||||
});
|
||||
if (!response.ok) {
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
/* Module Resolution Options */
|
||||
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
|
||||
"resolveJsonModule": true /* Allow importing .json files */,
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
|
||||
@@ -19,6 +19,7 @@ export const ZJsSyncInput = z.object({
|
||||
environmentId: z.string().cuid2(),
|
||||
personId: z.string().cuid2().optional(),
|
||||
sessionId: z.string().cuid2().optional(),
|
||||
jsVersion: z.string().optional(),
|
||||
});
|
||||
|
||||
export type TJsSyncInput = z.infer<typeof ZJsSyncInput>;
|
||||
|
||||
Reference in New Issue
Block a user