usetraceforge 0.1.17 → 0.1.19

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/index.js CHANGED
@@ -128,7 +128,7 @@ const TraceForge = {
128
128
  const previousEndpoint = config?.endpoint ?? defaultEndpoint;
129
129
  config = {
130
130
  endpoint: defaultEndpoint,
131
- autoCapture: false,
131
+ autoCapture: typeof window !== "undefined",
132
132
  ...options
133
133
  };
134
134
  const currentEndpoint = config.endpoint || defaultEndpoint;
package/dist/react.js CHANGED
@@ -34,8 +34,9 @@ export class TraceForgeErrorBoundary extends Component {
34
34
  }
35
35
  export function TraceForgeProvider({ children, apiKey, endpoint, }) {
36
36
  React.useEffect(() => {
37
- const finalApiKey = apiKey || process.env.NEXT_PUBLIC_TRACEFORGE_API_KEY;
38
- const finalEndpoint = endpoint || process.env.NEXT_PUBLIC_TRACEFORGE_INGEST_URL;
37
+ const envObj = typeof process !== "undefined" && process.env ? process.env : {};
38
+ const finalApiKey = apiKey || envObj.NEXT_PUBLIC_TRACEFORGE_API_KEY;
39
+ const finalEndpoint = endpoint || envObj.NEXT_PUBLIC_TRACEFORGE_INGEST_URL;
39
40
  if (finalApiKey) {
40
41
  TraceForge.init({
41
42
  apiKey: finalApiKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usetraceforge",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "private": false,
5
5
  "description": "TraceForge JavaScript SDK for sending errors to a TraceForge ingest endpoint.",
6
6
  "type": "module",