@supashiphq/react-sdk 0.7.17 → 1.0.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/README.md +13 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ function App() {
|
|
|
28
28
|
return (
|
|
29
29
|
<SupaProvider
|
|
30
30
|
config={{
|
|
31
|
-
|
|
31
|
+
sdkKey: 'your-sdk-key',
|
|
32
32
|
environment: 'production',
|
|
33
33
|
features,
|
|
34
34
|
context: {
|
|
@@ -120,7 +120,7 @@ The provider component that makes feature flags available to your React componen
|
|
|
120
120
|
import { createFeatures } from '@supashiphq/react-sdk'
|
|
121
121
|
|
|
122
122
|
const config = {
|
|
123
|
-
|
|
123
|
+
sdkKey: 'your-sdk-key',
|
|
124
124
|
environment: 'production',
|
|
125
125
|
features: createFeatures({
|
|
126
126
|
// Required: define all feature flags with fallback values
|
|
@@ -133,6 +133,8 @@ const config = {
|
|
|
133
133
|
email: 'user@example.com',
|
|
134
134
|
plan: 'premium',
|
|
135
135
|
},
|
|
136
|
+
// Hash sensitive context properties such as PII on the client before sending to Edge
|
|
137
|
+
sensitiveContextProperties: ['email', 'userID'],
|
|
136
138
|
networkConfig: {
|
|
137
139
|
// Optional: network settings
|
|
138
140
|
featuresAPIUrl: 'https://api.supashiphq.com/features',
|
|
@@ -146,6 +148,8 @@ const config = {
|
|
|
146
148
|
}
|
|
147
149
|
```
|
|
148
150
|
|
|
151
|
+
> Privacy note: set `sensitiveContextProperties` to hash PII/sensitive context property values on the client before requests are sent to the Edge API.
|
|
152
|
+
|
|
149
153
|
**Supported Feature Value Types:**
|
|
150
154
|
|
|
151
155
|
| Type | Example | Description |
|
|
@@ -454,7 +458,7 @@ function App() {
|
|
|
454
458
|
return (
|
|
455
459
|
<SupaProvider
|
|
456
460
|
config={{
|
|
457
|
-
|
|
461
|
+
sdkKey: 'your-sdk-key',
|
|
458
462
|
features: FEATURE_FLAGS,
|
|
459
463
|
context: {
|
|
460
464
|
userId: user?.id,
|
|
@@ -538,7 +542,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
538
542
|
return (
|
|
539
543
|
<SupaProvider
|
|
540
544
|
config={{
|
|
541
|
-
|
|
545
|
+
sdkKey: process.env.NEXT_PUBLIC_SUPASHIP_SDK_KEY!,
|
|
542
546
|
environment: process.env.NODE_ENV!,
|
|
543
547
|
features: FEATURE_FLAGS,
|
|
544
548
|
}}
|
|
@@ -587,7 +591,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
|
|
587
591
|
return (
|
|
588
592
|
<SupaProvider
|
|
589
593
|
config={{
|
|
590
|
-
|
|
594
|
+
sdkKey: process.env.NEXT_PUBLIC_SUPASHIP_SDK_KEY!,
|
|
591
595
|
environment: process.env.NODE_ENV!,
|
|
592
596
|
features: FEATURE_FLAGS,
|
|
593
597
|
}}
|
|
@@ -613,9 +617,9 @@ function App() {
|
|
|
613
617
|
return (
|
|
614
618
|
<SupaProvider
|
|
615
619
|
config={{
|
|
616
|
-
|
|
620
|
+
sdkKey: import.meta.env.VITE_SUPASHIP_SDK_KEY, // Vite
|
|
617
621
|
// or
|
|
618
|
-
|
|
622
|
+
sdkKey: process.env.REACT_APP_SUPASHIP_SDK_KEY, // CRA
|
|
619
623
|
environment: import.meta.env.MODE,
|
|
620
624
|
features: FEATURE_FLAGS,
|
|
621
625
|
}}
|
|
@@ -665,7 +669,7 @@ export function TestProviders({ children, features = {} as FeaturesWithFallbacks
|
|
|
665
669
|
return (
|
|
666
670
|
<SupaProvider
|
|
667
671
|
config={{
|
|
668
|
-
|
|
672
|
+
sdkKey: 'test-key',
|
|
669
673
|
environment: 'test',
|
|
670
674
|
features,
|
|
671
675
|
context: {},
|
|
@@ -758,7 +762,7 @@ function App() {
|
|
|
758
762
|
|
|
759
763
|
#### Features Not Loading
|
|
760
764
|
|
|
761
|
-
- **Check
|
|
765
|
+
- **Check SDK key:** Verify your SDK key is correct
|
|
762
766
|
- **Check network:** Open browser dev tools and check network requests
|
|
763
767
|
- **Check features config:** Ensure features are defined in the config
|
|
764
768
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supashiphq/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Supaship SDK for React",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react-dom": ">=16.8.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@supashiphq/javascript-sdk": "^0.
|
|
42
|
+
"@supashiphq/javascript-sdk": "^1.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@jest/globals": "^30.0.0",
|