@geejay/use-feature-flags 1.0.9 → 1.0.10

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.
@@ -1,7 +1,7 @@
1
1
  import { FeatureFlag } from './store';
2
2
  export declare const DEFAULT_SUPABASE_URL = "https://khppgsehvvlukzfdqbuo.supabase.co";
3
3
  export declare const DEFAULT_SUPABASE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtocHBnc2VodnZsdWt6ZmRxYnVvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTI2ODU1MzQsImV4cCI6MjA2ODI2MTUzNH0.8Z4VY4HFMm95UgO21c-DnDkbLPN_0mbDBZJPExaghDk";
4
- export declare function useFeatureFlags(passedKey?: string, environment?: string): {
4
+ export declare function useFeatureFlags(passedKey?: string, environment?: string | Location): {
5
5
  isActive: (key: string) => boolean;
6
6
  flags: FeatureFlag[];
7
7
  loading: boolean;
@@ -6,7 +6,7 @@ export const DEFAULT_SUPABASE_URL = 'https://khppgsehvvlukzfdqbuo.supabase.co';
6
6
  export const DEFAULT_SUPABASE_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtocHBnc2VodnZsdWt6ZmRxYnVvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTI2ODU1MzQsImV4cCI6MjA2ODI2MTUzNH0.8Z4VY4HFMm95UgO21c-DnDkbLPN_0mbDBZJPExaghDk';
7
7
  const EDGE_FN_URL = `${DEFAULT_SUPABASE_URL}/functions/v1/get-feature-flags`;
8
8
  let initialized = false;
9
- export function useFeatureFlags(passedKey, environment = 'localhost') {
9
+ export function useFeatureFlags(passedKey, environment = window.location || 'localhost') {
10
10
  const [state, setState] = useAtom(featureFlagsAtom);
11
11
  const [envId, setEnvId] = useState(null);
12
12
  const debounceTimeout = useRef(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geejay/use-feature-flags",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "React hook for feature flag management using Supabase",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",