@getdevteam/analytics-react-native 0.1.0-dev.1 → 0.1.0-dev.2
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 +31 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @getdevteam/analytics-react-native
|
|
2
|
+
|
|
3
|
+
React Native / Expo SDK for the [DevTeam Analytics & Logging Platform](https://github.com/getdevteam-ai/analytics).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @getdevteam/analytics-react-native @react-native-async-storage/async-storage
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Use
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createAnalytics } from "@getdevteam/analytics-react-native";
|
|
15
|
+
|
|
16
|
+
const analytics = createAnalytics({
|
|
17
|
+
key: "dtp_your_public_key",
|
|
18
|
+
host: "https://ingest.analytics.getdevteam.ai",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
analytics.screen("Home", { tab: "featured" }); // screen view
|
|
22
|
+
analytics.track("add_to_cart", { sku: "A-1" });
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`@react-native-async-storage/async-storage` lets identity survive app restarts.
|
|
26
|
+
The SDK auto-flushes when the app goes to the background.
|
|
27
|
+
On a physical device use your machine's LAN IP instead of `localhost` when pointing at a local backend.
|
|
28
|
+
|
|
29
|
+
You need a public ingest key (`dtp_...`) and the ingest host URL for your environment - see [Getting a key](https://github.com/getdevteam-ai/analytics/tree/main/src/sdk#getting-a-key) in the full SDK docs.
|
|
30
|
+
|
|
31
|
+
Full client API, config options, and release process: [src/sdk README](https://github.com/getdevteam-ai/analytics/tree/main/src/sdk).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getdevteam/analytics-react-native",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.2",
|
|
4
4
|
"description": "React Native SDK for the DevTeam analytics and logging platform.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typecheck": "tsc --noEmit"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@getdevteam/analytics-core": "0.1.0-dev.
|
|
40
|
+
"@getdevteam/analytics-core": "0.1.0-dev.2"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@react-native-async-storage/async-storage": ">=1.19.0",
|