@sylphx/sdk 0.3.7 → 0.4.0
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.d.cts +360 -1
- package/dist/index.d.ts +360 -1
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +100 -0
- package/dist/index.mjs.map +1 -1
- package/dist/nextjs/index.js +7 -2
- package/dist/nextjs/index.js.map +1 -1
- package/dist/nextjs/index.mjs +7 -2
- package/dist/nextjs/index.mjs.map +1 -1
- package/dist/react/index.d.cts +330 -1
- package/dist/react/index.d.ts +330 -1
- package/dist/react/index.js +710 -543
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +384 -221
- package/dist/react/index.mjs.map +1 -1
- package/dist/server/index.js +30 -11
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +30 -11
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/nextjs/index.js
CHANGED
|
@@ -511,7 +511,12 @@ function createSylphxMiddleware(userConfig = {}) {
|
|
|
511
511
|
);
|
|
512
512
|
}
|
|
513
513
|
const secretKey = validateAndSanitizeSecretKey(rawSecretKey);
|
|
514
|
-
const platformUrl = (
|
|
514
|
+
const platformUrl = (() => {
|
|
515
|
+
if (userConfig.platformUrl) return userConfig.platformUrl.trim();
|
|
516
|
+
const parts = secretKey.split("_");
|
|
517
|
+
const ref = parts.length === 4 ? parts[2] : null;
|
|
518
|
+
return ref ? `https://${ref}.${DEFAULT_SDK_API_HOST}` : `https://${DEFAULT_SDK_API_HOST}`;
|
|
519
|
+
})();
|
|
515
520
|
const namespace = getCookieNamespace(secretKey);
|
|
516
521
|
const cookieNames = getCookieNames(namespace);
|
|
517
522
|
const config = {
|
|
@@ -1869,7 +1874,7 @@ function configureServer(config) {
|
|
|
1869
1874
|
const secretKey = validateAndSanitizeSecretKey(config.secretKey);
|
|
1870
1875
|
serverConfig = {
|
|
1871
1876
|
secretKey,
|
|
1872
|
-
platformUrl: `https://${DEFAULT_SDK_API_HOST}`.trim()
|
|
1877
|
+
platformUrl: config.platformUrl?.trim() || `https://${DEFAULT_SDK_API_HOST}`.trim()
|
|
1873
1878
|
};
|
|
1874
1879
|
}
|
|
1875
1880
|
function getConfig() {
|