@safercity/sdk-react-native 0.1.2 → 0.2.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 +17 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
React Native adapter for SaferCity SDK with expo-fetch streaming support and secure token storage.
|
|
4
4
|
|
|
5
|
+
## What's New in v0.2.0
|
|
6
|
+
|
|
7
|
+
- **SDK Overhaul Alignment** - Updated to reflect v0.2.0 changes in core, client, and react packages.
|
|
8
|
+
- **User Scoping** - Full support for `userId` in `SaferCityProvider` and client options.
|
|
9
|
+
- **New Hooks** - Access to all new hooks from `@safercity/sdk-react` including Panic Information.
|
|
10
|
+
|
|
11
|
+
## What's New in v0.1.3
|
|
12
|
+
|
|
13
|
+
- **Version update** - Updated to reflect v0.1.3 changes in core and react packages
|
|
14
|
+
|
|
5
15
|
## Installation
|
|
6
16
|
|
|
7
17
|
```bash
|
|
@@ -166,20 +176,19 @@ const client = createReactNativeClient({
|
|
|
166
176
|
All hooks from `@safercity/sdk-react` work seamlessly:
|
|
167
177
|
|
|
168
178
|
```tsx
|
|
169
|
-
import {
|
|
179
|
+
import { useUser, useCreatePanic } from '@safercity/sdk-react';
|
|
170
180
|
|
|
171
|
-
function
|
|
172
|
-
const { data, isLoading, error } =
|
|
181
|
+
function Profile({ userId }: { userId: string }) {
|
|
182
|
+
const { data, isLoading, error } = useUser(userId);
|
|
173
183
|
|
|
174
184
|
if (isLoading) return <ActivityIndicator />;
|
|
175
185
|
if (error) return <Text>Error: {error.message}</Text>;
|
|
176
186
|
|
|
177
187
|
return (
|
|
178
|
-
<
|
|
179
|
-
data
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
/>
|
|
188
|
+
<View>
|
|
189
|
+
<Text>Name: {data?.data.firstName} {data?.data.lastName}</Text>
|
|
190
|
+
<Text>Status: {data?.data.status}</Text>
|
|
191
|
+
</View>
|
|
183
192
|
);
|
|
184
193
|
}
|
|
185
194
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@safercity/sdk-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React Native adapter for SaferCity SDK with expo-fetch streaming support",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"prepublishOnly": "bun run build"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@safercity/sdk": "
|
|
37
|
-
"@safercity/sdk-core": "
|
|
36
|
+
"@safercity/sdk": "0.2.0",
|
|
37
|
+
"@safercity/sdk-core": "0.2.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": ">=18.0.0",
|