@keyframerdev/vitals 0.1.3 → 0.1.4

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 CHANGED
@@ -27,12 +27,15 @@ At the app's entry, with the project's field key (`kfp_live_…`, public and wri
27
27
  ```ts
28
28
  import { startVitals } from '@keyframerdev/vitals'
29
29
  import AsyncStorage from '@react-native-async-storage/async-storage'
30
- import * as Application from 'expo-application'
30
+ import Constants from 'expo-constants'
31
+ import { Platform } from 'react-native'
32
+
33
+ const build = Platform.OS === 'ios' ? Constants.platform?.ios?.buildNumber : Constants.expoConfig?.android?.versionCode
31
34
 
32
35
  startVitals({
33
36
  key: 'kfp_live_…',
34
- appVersion: Application.nativeApplicationVersion!,
35
- build: Application.nativeBuildVersion ?? undefined,
37
+ appVersion: Constants.expoConfig?.version ?? '0',
38
+ build: build == null ? undefined : String(build),
36
39
  navigationRef, // React Navigation's createNavigationContainerRef() or expo-router's useNavigationContainerRef()
37
40
  storage: AsyncStorage, // optional: checkpoints, retries and the daily cap survive restarts
38
41
  })
@@ -40,6 +43,10 @@ startVitals({
40
43
 
41
44
  Nothing is measured or sent before `startVitals`. If your app asks for consent, call it after.
42
45
 
46
+ `expo-constants` rather than `expo-application`: the latter is a native module, and an EAS Update that adds it crashes every installed binary built without it. Without Expo, use `react-native-device-info` or your own constants.
47
+
48
+ Before your store release, declare it in the stores' privacy forms (App Store: Diagnostics > Performance Data; Google Play: Diagnostics) and add a sentence to your privacy policy: [what to declare](https://keyframer.dev/inspector/docs/vitals/store-privacy).
49
+
43
50
  | Option | Default | What it does |
44
51
  | --- | --- | --- |
45
52
  | `key` | required | The project's field key |
package/dist/index.js CHANGED
@@ -624,7 +624,7 @@ var MAX_FRAME_MS = 10 * 60 * 1000;
624
624
 
625
625
  // src/version.ts
626
626
  var SDK_NAME = "@keyframerdev/vitals";
627
- var SDK_VERSION = "0.1.3";
627
+ var SDK_VERSION = "0.1.4";
628
628
 
629
629
  // src/controller.ts
630
630
  var STORAGE_KEYS = {
@@ -1221,7 +1221,11 @@ class VitalsController {
1221
1221
  if (run !== this.run || !this.opts)
1222
1222
  return;
1223
1223
  try {
1224
- const res = await this.env.fetch(`${this.endpoint()}/v1/config/${encodeURIComponent(this.opts.key)}`, { method: "GET", headers: {} });
1224
+ const fresh = Math.round(this.env.wall()).toString(36);
1225
+ const res = await this.env.fetch(`${this.endpoint()}/v1/config/${encodeURIComponent(this.opts.key)}?t=${fresh}`, {
1226
+ method: "GET",
1227
+ headers: { "Cache-Control": "no-cache" }
1228
+ });
1225
1229
  if (run !== this.run)
1226
1230
  return;
1227
1231
  if (res.status === 200) {
@@ -1,3 +1,3 @@
1
1
  /** This package's version: sent in every report's `sdk`, and compared with the config's `minSdk`. Keep it in step with package.json. */
2
2
  export declare const SDK_NAME = "@keyframerdev/vitals";
3
- export declare const SDK_VERSION = "0.1.3";
3
+ export declare const SDK_VERSION = "0.1.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keyframerdev/vitals",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Motion Vitals for React Native: slow frames and janky animations from production, by screen and call site",
5
5
  "keywords": [
6
6
  "react-native",