@marvalt/madapter 2.2.1 → 2.2.2

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.esm.js CHANGED
@@ -2412,16 +2412,13 @@ const MauticForm = ({ formId, title, description, className = '', form, onSubmit
2412
2412
  const submitMutation = useMauticFormSubmission();
2413
2413
  // Get Turnstile site key from environment
2414
2414
  const getTurnstilesiteKey = () => {
2415
- // Check for Vite environment (browser)
2416
- if (typeof window !== 'undefined' && window.import?.meta?.env) {
2417
- return window.import.meta.env.VITE_TURNSTILE_SITE_KEY;
2418
- }
2419
- // Check for direct import.meta (Vite)
2420
2415
  try {
2421
2416
  // @ts-ignore - import.meta is a Vite-specific global
2422
2417
  if (typeof import.meta !== 'undefined' && import.meta.env) {
2423
2418
  // @ts-ignore
2424
- return import.meta.env.VITE_TURNSTILE_SITE_KEY;
2419
+ const key = import.meta.env.VITE_TURNSTILE_SITE_KEY;
2420
+ // Ensure we return a string or undefined, not an object
2421
+ return typeof key === 'string' ? key : undefined;
2425
2422
  }
2426
2423
  }
2427
2424
  catch (e) {