usetraceforge 0.1.17 → 0.1.18
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/react.js +3 -2
- package/package.json +1 -1
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
|
|
38
|
-
const
|
|
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,
|