@guidelytech/react-native 0.6.2 → 0.8.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Guidely
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -92,6 +92,39 @@ Provider props: `projectId`, `apiUrl`, `environment`, `storage`, `user`, `debug`
92
92
  `showResourceCenterLauncher` (default `false`), `showMessengerLauncher` (default `true`), `insets`,
93
93
  `launcherOffset` (default 72).
94
94
 
95
+ ## Feature flags
96
+
97
+ Built in, with the same `projectId` — nothing to configure:
98
+
99
+ ```tsx
100
+ import { Feature, FeatureValue, useFeatureValue, useFlag, useGuidely } from "@guidelytech/react-native";
101
+
102
+ function Checkout() {
103
+ const newCheckout = useFlag("new-checkout"); // boolean flags
104
+ const color = useFeatureValue("checkout-button-color", "blue"); // string / number / JSON
105
+ return (
106
+ <Feature flag="new-dashboard-banner" fallback={<OldBanner />}>
107
+ <NewBanner />
108
+ </Feature>
109
+ );
110
+ }
111
+
112
+ useGuidely().isFeatureEnabled("new-checkout"); // or getFeatureValue / getFeatureDetails / flags
113
+ ```
114
+
115
+ Flags evaluate on the device with `id` (user id, else the anonymous id), `anonymousId`, identify
116
+ traits, `account`, `$audiences`, `screen`, `path`, `platform` (`ios` / `android`), `deviceType`,
117
+ `appVersion`, `locale` and `environment`, plus `flagAttributes` from the provider. The last payload
118
+ is kept in `storage`, so flags work offline from a cold start; they refresh when the app returns to
119
+ the foreground. Experiment exposures are tracked as `experiment_viewed` events.
120
+
121
+ | | |
122
+ |---|---|
123
+ | `useFlag(key, fallback = false)`, `useFeatureValue(key, fallback)`, `useFlagDetails(key, fallback)`, `useFlags()`, `useFlagsReady()`, `useFlagsClient()` | Hooks (same as `@guidelytech/react`). |
124
+ | `<Feature flag fallback>` (alias `<FeatureFlag>`), `<FeatureValue flag value fallback>` | Conditional rendering. |
125
+ | `<FlagsProvider sdkKey storage attributes>` | Flags only, without guides or analytics. |
126
+ | Provider props `flagAttributes`, `flagsPayload`, `flags` | Extra attributes; a bootstrap payload; `false` or flags client options. |
127
+
95
128
  ## Scout messenger
96
129
 
97
130
  When Scout is on for iOS/Android (dashboard → Scout → *Show it on*), a chat bubble opens a native