@proveanything/smartlinks 1.0.46 → 1.0.47
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/API_SUMMARY.md +1 -1
- package/README.md +4 -1
- package/dist/http.js +2 -1
- package/package.json +1 -1
package/API_SUMMARY.md
CHANGED
package/README.md
CHANGED
|
@@ -149,9 +149,12 @@ initializeApi({
|
|
|
149
149
|
apiKey?: string, // Node/server only
|
|
150
150
|
bearerToken?: string, // optional at init; set by auth.login/verifyToken
|
|
151
151
|
proxyMode?: boolean // set true if running inside an iframe and using parent proxy
|
|
152
|
-
ngrokSkipBrowserWarning?: boolean //
|
|
152
|
+
ngrokSkipBrowserWarning?: boolean // forces header 'ngrok-skip-browser-warning: true'
|
|
153
153
|
extraHeaders?: Record<string,string> // custom headers merged in each request
|
|
154
154
|
})
|
|
155
|
+
|
|
156
|
+
// Auto-detection: If baseURL contains '.ngrok.io' or '.ngrok-free.dev' the header is added automatically
|
|
157
|
+
// unless you explicitly set ngrokSkipBrowserWarning: false.
|
|
155
158
|
```
|
|
156
159
|
|
|
157
160
|
When embedding the SDK in an iframe with `proxyMode: true`, you can also use:
|
package/dist/http.js
CHANGED
|
@@ -24,7 +24,8 @@ export function initializeApi(options) {
|
|
|
24
24
|
bearerToken = options.bearerToken;
|
|
25
25
|
proxyMode = !!options.proxyMode;
|
|
26
26
|
// Auto-enable ngrok skip header if domain contains .ngrok.io and user did not explicitly set the flag.
|
|
27
|
-
|
|
27
|
+
// Infer ngrok usage from common domains (.ngrok.io or .ngrok-free.dev)
|
|
28
|
+
const inferredNgrok = /(\.ngrok\.io|\.ngrok-free\.dev)(\b|\/)/i.test(baseURL);
|
|
28
29
|
ngrokSkipBrowserWarning = options.ngrokSkipBrowserWarning !== undefined
|
|
29
30
|
? !!options.ngrokSkipBrowserWarning
|
|
30
31
|
: inferredNgrok;
|