react-notify-sdk 1.0.35 → 1.0.36
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.
|
@@ -27,7 +27,7 @@ export const FeatureMessageProvider = ({ projectKey,
|
|
|
27
27
|
const [visible, setVisible] = useState(false);
|
|
28
28
|
const device = useDeviceDetection();
|
|
29
29
|
// Create supabase client with project key header
|
|
30
|
-
const supabaseClient = getSupabaseClient();
|
|
30
|
+
const supabaseClient = getSupabaseClient(projectKey);
|
|
31
31
|
useEffect(() => {
|
|
32
32
|
if (typeof window === 'undefined')
|
|
33
33
|
return; // Skip on server
|
|
@@ -4,7 +4,7 @@ import { SupabaseClient } from '@supabase/supabase-js';
|
|
|
4
4
|
* This connects to YOUR centralized notification platform database
|
|
5
5
|
* No configuration needed from developers - it's plug and play!
|
|
6
6
|
*/
|
|
7
|
-
export declare function getSupabaseClient(): SupabaseClient;
|
|
7
|
+
export declare function getSupabaseClient(projectKey: string): SupabaseClient;
|
|
8
8
|
/**
|
|
9
9
|
* Optional: Allow overriding the default configuration for testing/development
|
|
10
10
|
* This is mainly for your internal use during SDK development
|
|
@@ -8,9 +8,15 @@ let supabaseClient = null;
|
|
|
8
8
|
* This connects to YOUR centralized notification platform database
|
|
9
9
|
* No configuration needed from developers - it's plug and play!
|
|
10
10
|
*/
|
|
11
|
-
export function getSupabaseClient() {
|
|
11
|
+
export function getSupabaseClient(projectKey) {
|
|
12
12
|
if (!supabaseClient) {
|
|
13
|
-
supabaseClient = createClient(SDK_SUPABASE_URL, SDK_SUPABASE_ANON_KEY
|
|
13
|
+
supabaseClient = createClient(SDK_SUPABASE_URL, SDK_SUPABASE_ANON_KEY, {
|
|
14
|
+
global: {
|
|
15
|
+
headers: {
|
|
16
|
+
'x-projetc-key': projectKey
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
14
20
|
}
|
|
15
21
|
return supabaseClient;
|
|
16
22
|
}
|