@volr/react 0.2.2 → 0.2.4

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.cjs CHANGED
@@ -10760,7 +10760,7 @@ function VolrProvider({ config, children }) {
10760
10760
  const client = react.useMemo(() => {
10761
10761
  if (!config.projectApiKey) {
10762
10762
  throw new Error(
10763
- "VolrProvider requires config.projectApiKey. Please set VITE_PROJECT_API_KEY environment variable or provide projectApiKey in config."
10763
+ "VolrProvider requires config.projectApiKey. Please provide projectApiKey in config."
10764
10764
  );
10765
10765
  }
10766
10766
  return new APIClient({
@@ -19934,7 +19934,9 @@ Issued At: ${issuedAt}`;
19934
19934
  if (apiBaseUrl.includes("dev-api") || apiBaseUrl.includes("localhost")) {
19935
19935
  params.set("env", "dev");
19936
19936
  }
19937
- const lang = typeof navigator !== "undefined" ? navigator.language?.startsWith("ko") ? "ko" : "en" : "en";
19937
+ const detectedLang = typeof navigator !== "undefined" ? navigator.language?.toLowerCase().startsWith("ko") ? "ko" : "en" : "en";
19938
+ const allowedLocales = config.allowedLocales;
19939
+ const lang = allowedLocales && !allowedLocales.includes(detectedLang) ? "en" : detectedLang;
19938
19940
  params.set("lang", lang);
19939
19941
  return `https://sign.volr.io?${params.toString()}`;
19940
19942
  },