@obtrace/browser 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/auto.js CHANGED
@@ -45,14 +45,10 @@ function readEnvConfig() {
45
45
  let appId;
46
46
  let env;
47
47
  for (const p of prefixes) {
48
- apiKey = apiKey || resolveEnvVar(`${p}OBTRACE_API_KEY`);
49
- ingestBaseUrl = ingestBaseUrl || resolveEnvVar(`${p}OBTRACE_INGEST_BASE_URL`);
48
+ apiKey = apiKey || resolveEnvVar(`${p}OBTRACE_PUBLIC_KEY`) || resolveEnvVar(`${p}OBTRACE_API_KEY`);
50
49
  serviceName = serviceName || resolveEnvVar(`${p}OBTRACE_SERVICE_NAME`);
51
- appId = appId || resolveEnvVar(`${p}OBTRACE_APP_ID`);
52
- env = env || resolveEnvVar(`${p}OBTRACE_ENV`);
53
50
  }
54
- env = env || resolveEnvVar("NODE_ENV");
55
- return { apiKey, ingestBaseUrl, serviceName, appId, env };
51
+ return { apiKey, serviceName };
56
52
  }
57
53
  function merge(...sources) {
58
54
  const merged = {};
@@ -116,7 +112,7 @@ function autoInit() {
116
112
  return;
117
113
  }
118
114
  console.warn("[obtrace] No configuration found. Provide config via window.__OBTRACE_CONFIG__, " +
119
- '<meta name="obtrace-api-key">, or build-time env vars (VITE_OBTRACE_API_KEY, etc). ' +
115
+ '<meta name="obtrace-api-key">, or VITE_OBTRACE_PUBLIC_KEY env var. ' +
120
116
  "Deferring initialization until config appears.");
121
117
  setupDeferredInit();
122
118
  }
@@ -3,17 +3,10 @@ export function initViteBrowserSDK(config) {
3
3
  return initBrowserSDK(config);
4
4
  }
5
5
  export function createViteConfigFromImportMetaEnv(env, base) {
6
- const apiKey = env.VITE_OBTRACE_API_KEY ?? "";
7
- const ingestBaseUrl = env.VITE_OBTRACE_INGEST_BASE_URL || "https://ingest.obtrace.ai";
8
- const serviceName = base.serviceName ?? env.VITE_OBTRACE_SERVICE_NAME ?? "vite-app";
6
+ const apiKey = env.VITE_OBTRACE_PUBLIC_KEY ?? env.VITE_OBTRACE_API_KEY ?? "";
9
7
  return {
10
8
  ...base,
11
9
  apiKey,
12
- ingestBaseUrl,
13
- serviceName,
14
- tenantId: base.tenantId ?? env.VITE_OBTRACE_TENANT_ID,
15
- projectId: base.projectId ?? env.VITE_OBTRACE_PROJECT_ID,
16
- appId: base.appId ?? env.VITE_OBTRACE_APP_ID,
17
- env: base.env ?? env.MODE ?? env.VITE_OBTRACE_ENV ?? "dev"
10
+ serviceName: base.serviceName ?? "vite-app",
18
11
  };
19
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obtrace/browser",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Obtrace Browser SDK with frontend wrappers",
5
5
  "type": "module",
6
6
  "license": "MIT",