expo-observe 58.0.3 → 58.0.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/index.d.ts +1 -1
  3. package/build/index.js.map +1 -1
  4. package/build/module.js +33 -0
  5. package/build/module.js.map +1 -1
  6. package/build/types.d.ts +27 -1
  7. package/build/types.js.map +1 -1
  8. package/expo-module.config.json +1 -1
  9. package/local-maven-repo/expo/modules/observe/expo.modules.observe/{58.0.3/expo.modules.observe-58.0.3-sources.jar → 58.0.4/expo.modules.observe-58.0.4-sources.jar} +0 -0
  10. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4-sources.jar.md5 +1 -0
  11. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4-sources.jar.sha1 +1 -0
  12. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4-sources.jar.sha256 +1 -0
  13. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4-sources.jar.sha512 +1 -0
  14. package/local-maven-repo/expo/modules/observe/expo.modules.observe/{58.0.3/expo.modules.observe-58.0.3.aar → 58.0.4/expo.modules.observe-58.0.4.aar} +0 -0
  15. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.aar.md5 +1 -0
  16. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.aar.sha1 +1 -0
  17. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.aar.sha256 +1 -0
  18. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.aar.sha512 +1 -0
  19. package/local-maven-repo/expo/modules/observe/expo.modules.observe/{58.0.3/expo.modules.observe-58.0.3.module → 58.0.4/expo.modules.observe-58.0.4.module} +22 -22
  20. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.module.md5 +1 -0
  21. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.module.sha1 +1 -0
  22. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.module.sha256 +1 -0
  23. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.module.sha512 +1 -0
  24. package/local-maven-repo/expo/modules/observe/expo.modules.observe/{58.0.3/expo.modules.observe-58.0.3.pom → 58.0.4/expo.modules.observe-58.0.4.pom} +2 -2
  25. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.pom.md5 +1 -0
  26. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.pom.sha1 +1 -0
  27. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.pom.sha256 +1 -0
  28. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.4/expo.modules.observe-58.0.4.pom.sha512 +1 -0
  29. package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml +4 -4
  30. package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.md5 +1 -1
  31. package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.sha1 +1 -1
  32. package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.sha256 +1 -1
  33. package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.sha512 +1 -1
  34. package/package.json +4 -4
  35. package/src/index.ts +1 -0
  36. package/src/module.ts +32 -0
  37. package/src/types.ts +33 -1
  38. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3-sources.jar.md5 +0 -1
  39. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3-sources.jar.sha1 +0 -1
  40. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3-sources.jar.sha256 +0 -1
  41. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3-sources.jar.sha512 +0 -1
  42. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.aar.md5 +0 -1
  43. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.aar.sha1 +0 -1
  44. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.aar.sha256 +0 -1
  45. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.aar.sha512 +0 -1
  46. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.module.md5 +0 -1
  47. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.module.sha1 +0 -1
  48. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.module.sha256 +0 -1
  49. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.module.sha512 +0 -1
  50. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.pom.md5 +0 -1
  51. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.pom.sha1 +0 -1
  52. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.pom.sha256 +0 -1
  53. package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.3/expo.modules.observe-58.0.3.pom.sha512 +0 -1
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 58.0.4 — 2026-09-15
14
+
15
+ ### 🎉 New features
16
+
17
+ - Add a `networkTraces` option to `configure` to record network requests as trace spans, with an optional capture filter. Recording is opt-in, so it never adds to your event usage unless you turn it on. ([#48891](https://github.com/expo/expo/pull/48891) by [@tsapeta](https://github.com/tsapeta))
18
+
13
19
  ## 58.0.3 — 2026-09-14
14
20
 
15
21
  _This version does not introduce any user-facing changes._
package/build/index.d.ts CHANGED
@@ -12,5 +12,5 @@ export { ObserveRoot } from './ObserveRoot';
12
12
  export { Observe };
13
13
  /** @deprecated Import the named `Observe` export instead. */
14
14
  export default Observe;
15
- export type { ObserveAttribute, ObserveAttributes, ObserveConfig, ObserveIntegrationsConfig, ObserveModule, ObserveModuleEvents, ObserveNavigationIntegrationConfig, } from './types';
15
+ export type { ObserveAttribute, ObserveAttributes, ObserveConfig, ObserveIntegrationsConfig, ObserveModule, ObserveModuleEvents, ObserveNavigationIntegrationConfig, ObserveNetworkTracesConfig, } from './types';
16
16
  export { useObserve } from './useObserve';
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":[null],"names":["Observe","default","AppMetrics","ObserveErrorBoundary","ObserveInteractiveMarker","ObserveRoot","setBundleDefaults","environment","process","env","NODE_ENV","isJsDev","__DEV__","useObserve"],"mappings":"AAAA,OAAOA,aAAa,WAAW;AAE/B;;CAEC,GACD,SAASC,WAAWC,UAAU,QAAQ,mBAAmB;AAWzD,SAASC,oBAAoB,QAAQ,yBAAyB;AAK9D,SAASC,wBAAwB,QAAQ,6BAA6B;AAEtE,SAASC,WAAW,QAAQ,gBAAgB;AAE5CL,QAAQM,iBAAiB,CAAC;IACxBC,aAAaC,QAAQC,GAAG,CAACC,QAAQ,IAAI;IACrCC,SAAS,CAAC,CAACC;AACb;AAEA,SAASZ,OAAO,GAAG;AAEnB,2DAA2D,GAC3D,eAAeA,QAAQ;AAWvB,SAASa,UAAU,QAAQ,eAAe"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":[null],"names":["Observe","default","AppMetrics","ObserveErrorBoundary","ObserveInteractiveMarker","ObserveRoot","setBundleDefaults","environment","process","env","NODE_ENV","isJsDev","__DEV__","useObserve"],"mappings":"AAAA,OAAOA,aAAa,WAAW;AAE/B;;CAEC,GACD,SAASC,WAAWC,UAAU,QAAQ,mBAAmB;AAWzD,SAASC,oBAAoB,QAAQ,yBAAyB;AAK9D,SAASC,wBAAwB,QAAQ,6BAA6B;AAEtE,SAASC,WAAW,QAAQ,gBAAgB;AAE5CL,QAAQM,iBAAiB,CAAC;IACxBC,aAAaC,QAAQC,GAAG,CAACC,QAAQ,IAAI;IACrCC,SAAS,CAAC,CAACC;AACb;AAEA,SAASZ,OAAO,GAAG;AAEnB,2DAA2D,GAC3D,eAAeA,QAAQ;AAYvB,SAASa,UAAU,QAAQ,eAAe"}
package/build/module.js CHANGED
@@ -5,6 +5,35 @@ import { isRouterInstalled } from './integrations/expo-router/router';
5
5
  import { initReactNavigationIntegration } from './integrations/react-navigation/init';
6
6
  import { isReactNavigationInstalled } from './integrations/react-navigation/reactNavigation';
7
7
  import { reportCaughtError } from './reportCaughtError';
8
+ /**
9
+ * Normalizes the `networkTraces` sugar (`true` / `false` / `{ enabled, filter }`) into the config
10
+ * shape the native producer persists. `configure` is a full replacement, so an absent
11
+ * `networkTraces` resets to the default: disabled, no filter.
12
+ */ function networkTracesConfigFromOption(networkTraces) {
13
+ const option = networkTraces ?? false;
14
+ if (typeof option === 'boolean') {
15
+ return {
16
+ enabled: option
17
+ };
18
+ }
19
+ if (__DEV__) {
20
+ // Hosts are compared against the URL's host, so a full URL or a host:port pair matches
21
+ // nothing and silently records zero traces.
22
+ const malformed = option.filter?.hosts?.filter((host)=>/[/:]/.test(host));
23
+ if (malformed?.length) {
24
+ console.warn(`[expo-observe] \`networkTraces.filter.hosts\` expects bare hostnames, but got ${malformed.join(', ')}. ` + 'These match no request, so nothing will be recorded for them. Use "api.myapp.com" rather than "https://api.myapp.com/".');
25
+ }
26
+ }
27
+ // The object form records by default: passing a filter means "record these", so `enabled`
28
+ // only has to be spelled out to turn recording off while keeping the filter configured.
29
+ const enabled = option.enabled ?? true;
30
+ return option.filter != null ? {
31
+ enabled,
32
+ filter: option.filter
33
+ } : {
34
+ enabled
35
+ };
36
+ }
8
37
  const native = requireNativeModule('ExpoObserve');
9
38
  const Observe = new Proxy(native, {
10
39
  get (target, prop, receiver) {
@@ -13,6 +42,10 @@ const Observe = new Proxy(native, {
13
42
  // The handler is already installed at this point (it installs on import), so this only
14
43
  // toggles whether it records anything.
15
44
  setErrorHandlerEnabled(config.errorHandlingEnabled ?? true);
45
+ // Recording is gated in expo-app-metrics (the producer side), so the setting travels
46
+ // there rather than into the native `configure` payload. Applies to future captures
47
+ // only; spans persisted earlier in the launch still dispatch.
48
+ AppMetrics.setNetworkTracesConfig(networkTracesConfigFromOption(config.networkTraces));
16
49
  const routerEnabled = !!config.integrations?.['expo-router'];
17
50
  const reactNavigationEnabled = !!config.integrations?.['react-navigation'];
18
51
  if (routerEnabled && !isRouterInstalled) {
@@ -1 +1 @@
1
- {"version":3,"sources":["module.ts"],"sourcesContent":[null],"names":["requireNativeModule","AppMetrics","setErrorHandlerEnabled","initRouterIntegration","isRouterInstalled","initReactNavigationIntegration","isReactNavigationInstalled","reportCaughtError","native","Observe","Proxy","get","target","prop","receiver","config","errorHandlingEnabled","routerEnabled","integrations","reactNavigationEnabled","console","warn","shouldInitRouterIntegration","shouldInitReactNavigationIntegration","configure","error","name","callback","registerIntegrationImpl","Object","keys","includes","Reflect","getIntegrations","subscription","addListener","remove"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,OAAO;AAC3C,OAAOC,cAAcC,sBAAsB,QAAQ,mBAAmB;AAEtE,SAASC,qBAAqB,QAAQ,kCAAkC;AACxE,SAASC,iBAAiB,QAAQ,oCAAoC;AACtE,SAASC,8BAA8B,QAAQ,uCAAuC;AACtF,SAASC,0BAA0B,QAAQ,kDAAkD;AAC7F,SAASC,iBAAiB,QAAQ,sBAAsB;AAG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mB,QAAQrB,GAAG,CAACC,QAAQC,MAAMC;IACnC;AACF;AAEA,OAAO,SAASc,wBACdhB,MAA8D,EAC9Dc,IAAO,EACPC,QAAwD;IAExD,MAAMT,eAAeN,OAAOqB,eAAe;IAC3C,IAAIf,cAAc;QAChB,IAAIA,YAAY,CAACQ,KAAK,EAAE;YACtBC,SAAST,YAAY,CAACQ,KAAK;QAC7B;QACA;IACF;IAEA,MAAMQ,eAAetB,OAAOuB,WAAW,CAAC,aAAa,CAAC,EAAEjB,YAAY,EAAE;QACpEgB,aAAaE,MAAM;QACnB,IAAIlB,cAAc,CAACQ,KAAK,EAAE;YACxBC,SAAST,YAAY,CAACQ,KAAK;QAC7B;IACF;AACF;AAEA,eAAejB,QAAQ"}
1
+ {"version":3,"sources":["module.ts"],"sourcesContent":[null],"names":["requireNativeModule","AppMetrics","setErrorHandlerEnabled","initRouterIntegration","isRouterInstalled","initReactNavigationIntegration","isReactNavigationInstalled","reportCaughtError","networkTracesConfigFromOption","networkTraces","option","enabled","__DEV__","malformed","filter","hosts","host","test","length","console","warn","join","native","Observe","Proxy","get","target","prop","receiver","config","errorHandlingEnabled","setNetworkTracesConfig","routerEnabled","integrations","reactNavigationEnabled","shouldInitRouterIntegration","shouldInitReactNavigationIntegration","configure","error","name","callback","registerIntegrationImpl","Object","keys","includes","Reflect","getIntegrations","subscription","addListener","remove"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,OAAO;AAC3C,OAAOC,cAAcC,sBAAsB,QAAQ,mBAAmB;AAEtE,SAASC,qBAAqB,QAAQ,kCAAkC;AACxE,SAASC,iBAAiB,QAAQ,oCAAoC;AACtE,SAASC,8BAA8B,QAAQ,uCAAuC;AACtF,SAASC,0BAA0B,QAAQ,kDAAkD;AAC7F,SAASC,iBAAiB,QAAQ,sBAAsB;AAGxD;;;;CAIC,GACD,SAASC,8BAA8BC,aAA6C;IAClF,MAAMC,SAASD,iBAAiB;IAChC,IAAI,OAAOC,WAAW,WAAW;QAC/B,OA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E;gBAEN;gBAEA,IAAIe,6BAA6B;oBAC/BhC,sBAAsB0B,OAAOI,YAAY,EAAE,CAAC,cAAc;gBAC5D,OAAO,IAAIG,sCAAsC;oBAC/C/B,+BAA+BwB,OAAOI,YAAY,EAAE,CAAC,mBAAmB;gBAC1E;gBACA,OAAOP,OAAOW,SAAS,CAACR;YAC1B;QACF;QAEA,IAAIF,SAAS,eAAe;YAC1B,OAAO,CAACW,QAAmB/B,kBAAkB+B;QAC/C;QAEA,IAAIX,SAAS,uBAAuB;YAClC,OAAO,CACLY,MACAC,WACGC,wBAAwBf,QAAQa,MAAMC;QAC7C;QAEA,wGAAwG;QACxG,iGAAiG;QACjG,iGAAiG;QACjG,wEAAwE;QACxE,IAAI,OAAOb,SAAS,YAAY,CAACe,OAAOC,IAAI,CAACjB,QAAQkB,QAAQ,CAACjB,OAAO;YACnE,OAAOkB,QAAQpB,GAAG,CAACxB,YAAY0B;QACjC;QACA,OAAOkB,QAAQpB,GAAG,CAACC,QAAQC,MAAMC;IACnC;AACF;AAEA,OAAO,SAASa,wBACdf,MAA8D,EAC9Da,IAAO,EACPC,QAAwD;IAExD,MAAMP,eAAeP,OAAOoB,eAAe;IAC3C,IAAIb,cAAc;QAChB,IAAIA,YAAY,CAACM,KAAK,EAAE;YACtBC,SAASP,YAAY,CAACM,KAAK;QAC7B;QACA;IACF;IAEA,MAAMQ,eAAerB,OAAOsB,WAAW,CAAC,aAAa,CAAC,EAAEf,YAAY,EAAE;QACpEc,aAAaE,MAAM;QACnB,IAAIhB,cAAc,CAACM,KAAK,EAAE;YACxBC,SAASP,YAAY,CAACM,KAAK;QAC7B;IACF;AACF;AAEA,eAAehB,QAAQ"}
package/build/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { NativeModule } from 'expo';
2
- import type { LogAttributeValue, LogEventOptions, MetricAttributes } from 'expo-app-metrics';
2
+ import type { LogAttributeValue, LogEventOptions, MetricAttributes, NetworkRequestFilter } from 'expo-app-metrics';
3
3
  /**
4
4
  * Value types accepted as attribute values in `setGlobalAttributes` and the
5
5
  * other Observe APIs. Strings, numbers, and booleans are stored as typed
@@ -78,6 +78,32 @@ export type ObserveConfig = {
78
78
  * [integrate your own package](/eas/observe/integrations/third-party/).
79
79
  */
80
80
  integrations?: ObserveIntegrationsConfig;
81
+ /**
82
+ * Whether network requests are recorded as trace spans. Pass `true` to record every request,
83
+ * or an object to record only the ones matching a filter.
84
+ *
85
+ * Off by default, because each recorded span counts toward your event quota. This controls
86
+ * recording, not just export: a request that's turned off or filtered out never reaches the
87
+ * local database. It applies to future requests only, so anything recorded earlier in the
88
+ * launch still gets sent. The setting persists across launches.
89
+ *
90
+ * @default false
91
+ */
92
+ networkTraces?: boolean | ObserveNetworkTracesConfig;
93
+ };
94
+ export type ObserveNetworkTracesConfig = {
95
+ /**
96
+ * Whether network requests are recorded at all. Set it to `false` to keep a filter configured
97
+ * while recording nothing.
98
+ *
99
+ * @default true
100
+ */
101
+ enabled?: boolean;
102
+ /**
103
+ * Only requests matching the filter are recorded. An omitted field matches every request; an
104
+ * empty array matches none.
105
+ */
106
+ filter?: NetworkRequestFilter | null;
81
107
  };
82
108
  export type ObserveNavigationIntegrationConfig = {
83
109
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAqIA,WAyJC"}
1
+ {"version":3,"sources":["types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAqKA,WAyJC"}
@@ -9,7 +9,7 @@
9
9
  "publication": {
10
10
  "groupId": "expo.modules.observe",
11
11
  "artifactId": "expo.modules.observe",
12
- "version": "58.0.3",
12
+ "version": "58.0.4",
13
13
  "repository": "local-maven-repo"
14
14
  }
15
15
  }
@@ -0,0 +1 @@
1
+ 7cf6c16d146a11812c1c74b58cada5ed70e1224719c4b4e72aefa67bfc792e1c
@@ -0,0 +1 @@
1
+ 586058430ae58ffbdf3bd1171938847105471372d22dcada0842ae7c023df0f533dc2bee888b1edb2d5fe9212a4d6968c81151c5ca445f1c5c49297ab5debc6e
@@ -0,0 +1 @@
1
+ 00f75fc9681497c42a5bd1e4ed2d6b37e874cbef39af9ce4edecce57bfbc3dd6
@@ -0,0 +1 @@
1
+ 9fc3ea04f9d80fa21791aaa9b6f4e6739de87946d3e8fc897602c39ac2d7ab63926b366486e8f6929073927d894c6d7deeefd26579a7b0e32f1b7e3aca4157fd
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "expo.modules.observe",
5
5
  "module": "expo.modules.observe",
6
- "version": "58.0.3",
6
+ "version": "58.0.4",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.observe-58.0.3.aar",
28
- "url": "expo.modules.observe-58.0.3.aar",
29
- "size": 302568,
30
- "sha512": "67dbf0f4e1c8ed91a2e577ee7e0ce10f0056e1f3eacc3ba359947aaab8752634418f1ff9f676edde9daf4c10939b40f93bfe363ca6646ae19fb25f88a1a95172",
31
- "sha256": "aafd933bb3bf80a555522e3411bbebb0a9e98b4598dffd5c4bb1152fb6acf296",
32
- "sha1": "edd00418d41bd3da6372c576d02d865937a968a6",
33
- "md5": "9e22e11ed90e60765276fd3802175b7f"
27
+ "name": "expo.modules.observe-58.0.4.aar",
28
+ "url": "expo.modules.observe-58.0.4.aar",
29
+ "size": 302567,
30
+ "sha512": "9fc3ea04f9d80fa21791aaa9b6f4e6739de87946d3e8fc897602c39ac2d7ab63926b366486e8f6929073927d894c6d7deeefd26579a7b0e32f1b7e3aca4157fd",
31
+ "sha256": "00f75fc9681497c42a5bd1e4ed2d6b37e874cbef39af9ce4edecce57bfbc3dd6",
32
+ "sha1": "356a90fbfba518bf66c7628c1892a7e1da3894ed",
33
+ "md5": "b497d611b14506fc18a86e6714c1f746"
34
34
  }
35
35
  ]
36
36
  },
@@ -61,7 +61,7 @@
61
61
  "group": "expo.modules.appmetrics",
62
62
  "module": "expo.modules.appmetrics",
63
63
  "version": {
64
- "requires": "58.0.1"
64
+ "requires": "58.0.2"
65
65
  }
66
66
  },
67
67
  {
@@ -120,13 +120,13 @@
120
120
  ],
121
121
  "files": [
122
122
  {
123
- "name": "expo.modules.observe-58.0.3.aar",
124
- "url": "expo.modules.observe-58.0.3.aar",
125
- "size": 302568,
126
- "sha512": "67dbf0f4e1c8ed91a2e577ee7e0ce10f0056e1f3eacc3ba359947aaab8752634418f1ff9f676edde9daf4c10939b40f93bfe363ca6646ae19fb25f88a1a95172",
127
- "sha256": "aafd933bb3bf80a555522e3411bbebb0a9e98b4598dffd5c4bb1152fb6acf296",
128
- "sha1": "edd00418d41bd3da6372c576d02d865937a968a6",
129
- "md5": "9e22e11ed90e60765276fd3802175b7f"
123
+ "name": "expo.modules.observe-58.0.4.aar",
124
+ "url": "expo.modules.observe-58.0.4.aar",
125
+ "size": 302567,
126
+ "sha512": "9fc3ea04f9d80fa21791aaa9b6f4e6739de87946d3e8fc897602c39ac2d7ab63926b366486e8f6929073927d894c6d7deeefd26579a7b0e32f1b7e3aca4157fd",
127
+ "sha256": "00f75fc9681497c42a5bd1e4ed2d6b37e874cbef39af9ce4edecce57bfbc3dd6",
128
+ "sha1": "356a90fbfba518bf66c7628c1892a7e1da3894ed",
129
+ "md5": "b497d611b14506fc18a86e6714c1f746"
130
130
  }
131
131
  ]
132
132
  },
@@ -140,13 +140,13 @@
140
140
  },
141
141
  "files": [
142
142
  {
143
- "name": "expo.modules.observe-58.0.3-sources.jar",
144
- "url": "expo.modules.observe-58.0.3-sources.jar",
143
+ "name": "expo.modules.observe-58.0.4-sources.jar",
144
+ "url": "expo.modules.observe-58.0.4-sources.jar",
145
145
  "size": 27851,
146
- "sha512": "96d0aadc0a04524b07da7389582882041ba83eb982b1bc7ad73eb5f1102dfa6b69af17b9311ce9d6802e858c8770f6726b95e57eda2fd1ac5b7405f20b3507bc",
147
- "sha256": "ece6e25c3fb53d67fda76e3dd6475c559d9d19032be53e6f57605142d9c91659",
148
- "sha1": "399a8df4675a77aa31d349bd7b3ae489cf9ca9f2",
149
- "md5": "7f8c3c4e998cc5fcfa5660175624229e"
146
+ "sha512": "586058430ae58ffbdf3bd1171938847105471372d22dcada0842ae7c023df0f533dc2bee888b1edb2d5fe9212a4d6968c81151c5ca445f1c5c49297ab5debc6e",
147
+ "sha256": "7cf6c16d146a11812c1c74b58cada5ed70e1224719c4b4e72aefa67bfc792e1c",
148
+ "sha1": "6fd5316f10e456c0a4944aa5cf07c10dc7a6eaf6",
149
+ "md5": "2573ff6df1611260e5e4891bc514037f"
150
150
  }
151
151
  ]
152
152
  }
@@ -0,0 +1 @@
1
+ f3858b3ef31922bb90f31c846caadfaa0ae9e1026c33ebcfb9877e53c9fd9c97
@@ -0,0 +1 @@
1
+ 59462a08f8e0021f2997c7f5c29dd2b1a5ba05586d6e43949e9d1e50e104592d65d24b49ff889069b67f99864df84c70219d1362018ed4f38aafa090c27229be
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>expo.modules.observe</groupId>
11
11
  <artifactId>expo.modules.observe</artifactId>
12
- <version>58.0.3</version>
12
+ <version>58.0.4</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.observe</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -52,7 +52,7 @@
52
52
  <dependency>
53
53
  <groupId>expo.modules.appmetrics</groupId>
54
54
  <artifactId>expo.modules.appmetrics</artifactId>
55
- <version>58.0.1</version>
55
+ <version>58.0.2</version>
56
56
  <scope>runtime</scope>
57
57
  </dependency>
58
58
  <dependency>
@@ -0,0 +1 @@
1
+ ab3c02e553b193e7e7b59c55633f7401dd83f38f4a76593430512fcaac21f58a
@@ -0,0 +1 @@
1
+ aa618e7e00e12d2ca7c7676044f7d72f4c3ead6ba18148a47e353b27157be78ee7dc50e267fa83fc69bc9d454040a29ea12f8d12a4a2dd29cd635ed53876a4ec
@@ -3,11 +3,11 @@
3
3
  <groupId>expo.modules.observe</groupId>
4
4
  <artifactId>expo.modules.observe</artifactId>
5
5
  <versioning>
6
- <latest>58.0.3</latest>
7
- <release>58.0.3</release>
6
+ <latest>58.0.4</latest>
7
+ <release>58.0.4</release>
8
8
  <versions>
9
- <version>58.0.3</version>
9
+ <version>58.0.4</version>
10
10
  </versions>
11
- <lastUpdated>20260914155312</lastUpdated>
11
+ <lastUpdated>20260915202029</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 7b5b681ecd8f893bde49d7d90bb12877
1
+ 7465da64b95dec4d5b9fda3cb113419d
@@ -1 +1 @@
1
- 1495722c5b07cac1964aee1e1ce295e6703f16a9
1
+ e62d883c07f21133a91e064d6ed9f2d186f36a1c
@@ -1 +1 @@
1
- e21de52bd28a4714099376eaa7ca8bdfce23658a5cf7023b9c541f50cc121ecf
1
+ 04095cd5c55fb31750a231b24c3f89a1a829b889c11a000e13ea1ed2c9227fb5
@@ -1 +1 @@
1
- f01e0e4cfa00482813145d40296f6a4e530f223518a495a61a342deb2a442b0d4ae1670b11545f169702bbe5e1af1f31da5134febefcf7c189f0c4a058a79aa9
1
+ cd65bdf5ce83fd5071006c2d2c2ab935c77646a7d7d94c0eff22c76c954fba18bffe6e53ba4d27bffeff59e4d0bc3dff7453ffd3d75940e7e68f63bac7da9d6a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-observe",
3
- "version": "58.0.3",
3
+ "version": "58.0.4",
4
4
  "description": "Expo module that dispatches collected app metrics to EAS Observe",
5
5
  "keywords": [
6
6
  "EAS",
@@ -42,14 +42,14 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "expo-app-metrics": "~58.0.1",
45
+ "expo-app-metrics": "~58.0.2",
46
46
  "expo-eas-client": "~58.0.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@react-navigation/native": "^7.1.33",
50
50
  "@testing-library/react-native": "^13.3.0",
51
51
  "@types/react": "~19.2.0",
52
- "expo": "58.0.0-preview.1",
52
+ "expo": "58.0.0-preview.2",
53
53
  "expo-module-scripts": "56.0.3"
54
54
  },
55
55
  "peerDependencies": {
@@ -68,7 +68,7 @@
68
68
  }
69
69
  },
70
70
  "title": "Expo Observe",
71
- "gitHead": "40afe3afa42f1dcca3dcba7ffbb3641859bdf2f0",
71
+ "gitHead": "313e67f5c9dfb16f9deca74a271cd1d4f33a6f82",
72
72
  "scripts": {
73
73
  "build": "expo-build src",
74
74
  "clean": "expo-module clean",
package/src/index.ts CHANGED
@@ -41,5 +41,6 @@ export type {
41
41
  ObserveModule,
42
42
  ObserveModuleEvents,
43
43
  ObserveNavigationIntegrationConfig,
44
+ ObserveNetworkTracesConfig,
44
45
  } from './types';
45
46
  export { useObserve } from './useObserve';
package/src/module.ts CHANGED
@@ -8,6 +8,33 @@ import { isReactNavigationInstalled } from './integrations/react-navigation/reac
8
8
  import { reportCaughtError } from './reportCaughtError';
9
9
  import type { ObserveConfig, ObserveIntegrationsConfig, ObserveModule } from './types';
10
10
 
11
+ /**
12
+ * Normalizes the `networkTraces` sugar (`true` / `false` / `{ enabled, filter }`) into the config
13
+ * shape the native producer persists. `configure` is a full replacement, so an absent
14
+ * `networkTraces` resets to the default: disabled, no filter.
15
+ */
16
+ function networkTracesConfigFromOption(networkTraces: ObserveConfig['networkTraces']) {
17
+ const option = networkTraces ?? false;
18
+ if (typeof option === 'boolean') {
19
+ return { enabled: option };
20
+ }
21
+ if (__DEV__) {
22
+ // Hosts are compared against the URL's host, so a full URL or a host:port pair matches
23
+ // nothing and silently records zero traces.
24
+ const malformed = option.filter?.hosts?.filter((host) => /[/:]/.test(host));
25
+ if (malformed?.length) {
26
+ console.warn(
27
+ `[expo-observe] \`networkTraces.filter.hosts\` expects bare hostnames, but got ${malformed.join(', ')}. ` +
28
+ 'These match no request, so nothing will be recorded for them. Use "api.myapp.com" rather than "https://api.myapp.com/".'
29
+ );
30
+ }
31
+ }
32
+ // The object form records by default: passing a filter means "record these", so `enabled`
33
+ // only has to be spelled out to turn recording off while keeping the filter configured.
34
+ const enabled = option.enabled ?? true;
35
+ return option.filter != null ? { enabled, filter: option.filter } : { enabled };
36
+ }
37
+
11
38
  const native = requireNativeModule<ObserveModule>('ExpoObserve');
12
39
 
13
40
  const Observe: ObserveModule = new Proxy(native, {
@@ -18,6 +45,11 @@ const Observe: ObserveModule = new Proxy(native, {
18
45
  // toggles whether it records anything.
19
46
  setErrorHandlerEnabled(config.errorHandlingEnabled ?? true);
20
47
 
48
+ // Recording is gated in expo-app-metrics (the producer side), so the setting travels
49
+ // there rather than into the native `configure` payload. Applies to future captures
50
+ // only; spans persisted earlier in the launch still dispatch.
51
+ AppMetrics.setNetworkTracesConfig(networkTracesConfigFromOption(config.networkTraces));
52
+
21
53
  const routerEnabled = !!config.integrations?.['expo-router'];
22
54
  const reactNavigationEnabled = !!config.integrations?.['react-navigation'];
23
55
 
package/src/types.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import type { NativeModule } from 'expo';
2
- import type { LogAttributeValue, LogEventOptions, MetricAttributes } from 'expo-app-metrics';
2
+ import type {
3
+ LogAttributeValue,
4
+ LogEventOptions,
5
+ MetricAttributes,
6
+ NetworkRequestFilter,
7
+ } from 'expo-app-metrics';
3
8
 
4
9
  /**
5
10
  * Value types accepted as attribute values in `setGlobalAttributes` and the
@@ -81,6 +86,33 @@ export type ObserveConfig = {
81
86
  * [integrate your own package](/eas/observe/integrations/third-party/).
82
87
  */
83
88
  integrations?: ObserveIntegrationsConfig;
89
+ /**
90
+ * Whether network requests are recorded as trace spans. Pass `true` to record every request,
91
+ * or an object to record only the ones matching a filter.
92
+ *
93
+ * Off by default, because each recorded span counts toward your event quota. This controls
94
+ * recording, not just export: a request that's turned off or filtered out never reaches the
95
+ * local database. It applies to future requests only, so anything recorded earlier in the
96
+ * launch still gets sent. The setting persists across launches.
97
+ *
98
+ * @default false
99
+ */
100
+ networkTraces?: boolean | ObserveNetworkTracesConfig;
101
+ };
102
+
103
+ export type ObserveNetworkTracesConfig = {
104
+ /**
105
+ * Whether network requests are recorded at all. Set it to `false` to keep a filter configured
106
+ * while recording nothing.
107
+ *
108
+ * @default true
109
+ */
110
+ enabled?: boolean;
111
+ /**
112
+ * Only requests matching the filter are recorded. An omitted field matches every request; an
113
+ * empty array matches none.
114
+ */
115
+ filter?: NetworkRequestFilter | null;
84
116
  };
85
117
 
86
118
  export type ObserveNavigationIntegrationConfig = {
@@ -1 +0,0 @@
1
- ece6e25c3fb53d67fda76e3dd6475c559d9d19032be53e6f57605142d9c91659
@@ -1 +0,0 @@
1
- 96d0aadc0a04524b07da7389582882041ba83eb982b1bc7ad73eb5f1102dfa6b69af17b9311ce9d6802e858c8770f6726b95e57eda2fd1ac5b7405f20b3507bc
@@ -1 +0,0 @@
1
- aafd933bb3bf80a555522e3411bbebb0a9e98b4598dffd5c4bb1152fb6acf296
@@ -1 +0,0 @@
1
- 67dbf0f4e1c8ed91a2e577ee7e0ce10f0056e1f3eacc3ba359947aaab8752634418f1ff9f676edde9daf4c10939b40f93bfe363ca6646ae19fb25f88a1a95172
@@ -1 +0,0 @@
1
- f7294344c9411833e29d441a4ef8e61d950104fb029965b35fb2bd3961837823
@@ -1 +0,0 @@
1
- 5214c7f0564e2b44f49a5bca3d66b3e94beb2684b7d74c9974131958d9fb68cba42aa2df8881e13bffa31fd702dfc403a094e335e5fbbe3ad3ddeb15947708c3
@@ -1 +0,0 @@
1
- 23f8e2c5e1dce0474b314e4062d4ee06b893cd96f07f43fdc3786750b3734e6e
@@ -1 +0,0 @@
1
- 68fc369c755dac33b6b5cdf1068527005d47a09e487ebeb6d369166b64f51f5e327e2453cddc0a09a512224b7265fd7c3af8a2fe62777cf58a8478ff6c99201d