Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

feat(mobile): report mobile crashes to sentry

Mohamed Bassem5a371f4bb768
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index 326572ba..646479bd 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -36,6 +36,7 @@ jobs:
run: eas build --platform android --local --output ${{ github.workspace }}/app-release.aab
env:
EAS_SKIP_AUTO_FINGERPRINT: "1"
+ SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Upload AAB artifact
uses: actions/upload-artifact@v4
diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml
index d9529fb2..d17d8a2b 100644
--- a/.github/workflows/ios.yml
+++ b/.github/workflows/ios.yml
@@ -27,6 +27,7 @@ jobs:
run: eas build --platform ios --local --non-interactive --output ${{ github.workspace }}/app-release.ipa
env:
EAS_SKIP_AUTO_FINGERPRINT: "1"
+ SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Upload IPA artifact
uses: actions/upload-artifact@v4
diff --git a/apps/mobile/.gitignore b/apps/mobile/.gitignore
index 2920e5a8..73606408 100644
--- a/apps/mobile/.gitignore
+++ b/apps/mobile/.gitignore
@@ -37,3 +37,5 @@ yarn-error.*
#build files
ios/
android/
+
+.env.local
diff --git a/apps/mobile/app.config.js b/apps/mobile/app.config.js
index 5cac99da..26b7a25d 100644
--- a/apps/mobile/app.config.js
+++ b/apps/mobile/app.config.js
@@ -108,6 +108,14 @@ export default {
},
],
"expo-web-browser",
+ [
+ "@sentry/react-native/expo",
+ {
+ url: "https://sentry.io/",
+ project: "react-native",
+ organization: "localhost-labs-ltd",
+ },
+ ],
],
extra: {
router: {
diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx
index 730f17b0..619ea629 100644
--- a/apps/mobile/app/_layout.tsx
+++ b/apps/mobile/app/_layout.tsx
@@ -17,8 +17,20 @@ import { useColorScheme, useInitialAndroidBarSync } from "@/lib/useColorScheme";
import { cn } from "@/lib/utils";
import { NAV_THEME } from "@/theme";
import { ThemeProvider as NavThemeProvider } from "@react-navigation/native";
+import * as Sentry from "@sentry/react-native";
-export default function RootLayout() {
+Sentry.init({
+ dsn: "https://a61d93ed65066ed54c8566ba6b6a01d2@o4511008866172928.ingest.de.sentry.io/4511008868270160",
+
+ // Adds more context data to events (IP address, cookies, user, etc.)
+ // For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
+ sendDefaultPii: false,
+
+ // Enable Logs
+ enableLogs: false,
+});
+
+export default Sentry.wrap(function RootLayout() {
useInitialAndroidBarSync();
const router = useRouter();
const { hasShareIntent } = useShareIntent();
@@ -132,4 +144,4 @@ export default function RootLayout() {
<StatusBar style="auto" />
</SafeAreaProvider>
);
-}
+});
diff --git a/apps/mobile/metro.config.js b/apps/mobile/metro.config.js
index 78f79c62..2882ceb0 100644
--- a/apps/mobile/metro.config.js
+++ b/apps/mobile/metro.config.js
@@ -1,13 +1,12 @@
-// Learn more: https://docs.expo.dev/guides/monorepos/
-const { getDefaultConfig } = require("expo/metro-config");
const { FileStore } = require("metro-cache");
const { withNativeWind } = require("nativewind/metro");
const path = require("path");
+const { getSentryExpoConfig } = require("@sentry/react-native/metro");
module.exports = withTurborepoManagedCache(
withMonorepoPaths(
// eslint-disable-next-line no-undef
- withNativeWind(getDefaultConfig(__dirname), {
+ withNativeWind(getSentryExpoConfig(__dirname), {
input: "./globals.css",
configPath: "./tailwind.config.js",
inlineRem: 16,
diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index 876c040c..384eaddc 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -31,6 +31,7 @@
"@react-navigation/native": "^7.1.8",
"@rn-primitives/hooks": "^1.3.0",
"@rn-primitives/slot": "^1.2.0",
+ "@sentry/react-native": "^8.3.0",
"@shopify/flash-list": "2.0.2",
"@tanstack/react-query": "5.90.2",
"class-variance-authority": "^0.7.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7a3804ed..9f356dda 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -332,6 +332,9 @@ importers:
'@rn-primitives/slot':
specifier: ^1.2.0
+ '@sentry/react-native':
+ specifier: ^8.3.0
'@shopify/flash-list':
specifier: 2.0.2
@@ -5927,6 +5930,107 @@ packages:
'@selderee/[email protected]':
resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==}
+ '@sentry-internal/[email protected]':
+ resolution: {integrity: sha512-HCEICKvepxN4/6NYfnMMMlppcSwIEwtS66X6d1/mwaHdi2ivw0uGl52p7Nfhda/lIJArbrkWprxl0WcjZajhQA==}
+ engines: {node: '>=18'}
+
+ '@sentry-internal/[email protected]':
+ resolution: {integrity: sha512-lpPcHsog10MVYFTWE0Pf8vQRqQWwZHJpkVl2FEb9/HDdHFyTBUhCVoWo1KyKaG7GJl9AVKMAg7bp9SSNArhFNQ==}
+ engines: {node: '>=18'}
+
+ '@sentry-internal/[email protected]':
+ resolution: {integrity: sha512-am3m1Fj8ihoPfoYo41Qq4KeCAAICn4bySso8Oepu9dMNe9Lcnsf+reMRS2qxTPg3pZDc4JEMOcLyNCcgnAfrHw==}
+ engines: {node: '>=18'}
+
+ '@sentry-internal/[email protected]':
+ resolution: {integrity: sha512-Zh3EoaH39x2lqVY1YyVB2vJEyCIrT+YLUQxYl1yvP0MJgLxaR6akVjkgxbSUJahan4cX5DxpZiEHfzdlWnYPyQ==}
+ engines: {node: '>=18'}
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-x2wEpBHwsTyTF2rWsLKJlzrRF1TTIGOfX+ngdE+Yd5DBkoS58HwQv824QOviPGQRla4/ypISqAXzjdDPL/zalg==}
+ engines: {node: '>= 18'}
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-iXxYjXNEBwY1MH4lDSDZZUNjzPJDK7/YLwVIJq/3iBYpIQVIhaJsoJnf3clx9+NfJ8QFKyKfcvgae61zm+hgTA==}
+ engines: {node: '>=18'}
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-hifHfFP7Rv/5+RoMJcKy1EF1eLrWhmIBZ5O7mD3Y5wjvABosWF44lYJ7tfQ1Reu4yeYPr9UkXqnCf6ftPgeK9Q==}
+ engines: {node: '>=18'}
+ os: [darwin]
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-yNLmxu4mqep7YeJg29FQq9733EvWodZz9UillchtIzG3oX6DLGhf+ZGElSYNUMmNal4wEj30wOnXveMVLtNM0Q==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [linux, freebsd, android]
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-HTr08OF3+UGCt1RjcU4h37gHLbthSUf7dZzz4SGVHB3hiFzywBtnz6VibFY/U9HCqJNU9nW+WpdLkOpqzer5TA==}
+ engines: {node: '>=18'}
+ cpu: [arm]
+ os: [linux, freebsd, android]
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-xpYeO9lU7ua0ksToOibJpYvG3HFgwqH9VG9gt2fym8lgANpqM+Nxk2tdjiVsqddeD7R3tRLMhj6PjKFxUnI8KQ==}
+ engines: {node: '>=18'}
+ cpu: [x86, ia32]
+ os: [linux, freebsd, android]
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-sWgX7/kzGFHQYfJFEE2/k8I8+XqumznPJ+nEUnowjQZPZNKcK0gfX4kToJQ7BbyVS5VmxS45F3iM46+p1L2law==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [linux, freebsd, android]
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-GDKp3agjI56xxgSPH2Ycvd0rkwM6SawvIUIlY1SXXFU+2ecMTz+RqRKKVvyAF0p1lsTRMKtHQ2TzHpCYDPryig==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [win32]
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-5ZllXD0feaTWW7Va32HKx/j2TVnP2hQ6cfkrZP/cyst9Wz7YDq0Q44cbEQlMTpZREuSL0tAzG92omBR9wdca7A==}
+ engines: {node: '>=18'}
+ cpu: [x86, ia32]
+ os: [win32]
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-kgycTi6S2Vj5ZK9lRtDR9HO7d5Ep/JopVkzcaNxhpI5TNwCd0odXb0fy5MA09PQgPQhkys+viLDPdnpem0AWEw==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [win32]
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-E3a7LUkJLLOaxjbqdqnTiM5UUAgu/WmXKec6O9+mjh9p7N5znLMp8xZNokwQQKPqoPxwsInv2kvEAQdA/bhjzg==}
+ engines: {node: '>= 18'}
+ hasBin: true
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-L4rMrXMqUKBanpjpMT+TuAVk6xAijz6AWM6RiEYpohAr7SGcCEc1/T0+Ep1eLV8+pwWacfU27OvELIyNeOnGzA==}
+ engines: {node: '>=18'}
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-D7i3i/nqbAjuEnQyhup2eRNVAtIgINRlytXUsz2LeRb38Ws1vTPlZikdUzlOE3gi02aDtFj78a2dEqXID+t3Ug==}
+ hasBin: true
+ peerDependencies:
+ expo: '>=49.0.0'
+ react: '>=17.0.0'
+ react-native: '>=0.65.0'
+ peerDependenciesMeta:
+ expo:
+ optional: true
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-uigyz6E3yPjjqIZpkGzRChww6gzMmqdCpK30M5aBYoaen29DDmSECHYA16sfgXeSwzQhnXyX7GxgOB+eKIr9dw==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ react: ^16.14.0 || 17.x || 18.x || 19.x
+
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-KEZtRI1ldl0H77lTLxtnBTihiD0/mf7I26Y7S30mU96PzXFei9Lnm3v9YuDIjDM5R7KlFSmndg6K9Q2oBm8Wxg==}
+ engines: {node: '>=18'}
+
'@shopify/[email protected]':
resolution: {integrity: sha512-zhlrhA9eiuEzja4wxVvotgXHtqd3qsYbXkQ3rsBfOgbFA9BVeErpDE/yEwtlIviRGEqpuFj/oU5owD6ByaNX+w==}
peerDependencies:
@@ -10341,10 +10445,6 @@ packages:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
- resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==}
- engines: {node: '>=16'}
-
resolution: {integrity: sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==}
engines: {node: '>=18'}
@@ -13049,6 +13149,9 @@ packages:
resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==}
engines: {node: '>= 0.10'}
+ resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
+
resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==}
@@ -15072,6 +15175,10 @@ packages:
resolution: {integrity: sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==}
engines: {node: '>=18.17'}
+ resolution: {integrity: sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==}
+ engines: {node: '>=18.17'}
+
resolution: {integrity: sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==}
engines: {node: '>=20.18.1'}
@@ -21961,6 +22068,99 @@ snapshots:
domhandler: 5.0.3
selderee: 0.11.0
+ '@sentry-internal/[email protected]':
+ dependencies:
+ '@sentry/core': 10.42.0
+
+ '@sentry-internal/[email protected]':
+ dependencies:
+ '@sentry/core': 10.42.0
+
+ '@sentry-internal/[email protected]':
+ dependencies:
+ '@sentry-internal/replay': 10.42.0
+ '@sentry/core': 10.42.0
+
+ '@sentry-internal/[email protected]':
+ dependencies:
+ '@sentry-internal/browser-utils': 10.42.0
+ '@sentry/core': 10.42.0
+
+ '@sentry/[email protected]': {}
+
+ '@sentry/[email protected]':
+ dependencies:
+ '@sentry-internal/browser-utils': 10.42.0
+ '@sentry-internal/feedback': 10.42.0
+ '@sentry-internal/replay': 10.42.0
+ '@sentry-internal/replay-canvas': 10.42.0
+ '@sentry/core': 10.42.0
+
+ '@sentry/[email protected]':
+ optional: true
+
+ '@sentry/[email protected]':
+ optional: true
+
+ '@sentry/[email protected]':
+ optional: true
+
+ '@sentry/[email protected]':
+ optional: true
+
+ '@sentry/[email protected]':
+ optional: true
+
+ '@sentry/[email protected]':
+ optional: true
+
+ '@sentry/[email protected]':
+ optional: true
+
+ '@sentry/[email protected]':
+ optional: true
+
+ '@sentry/[email protected]':
+ dependencies:
+ progress: 2.0.3
+ proxy-from-env: 1.1.0
+ undici: 6.23.0
+ which: 2.0.2
+ optionalDependencies:
+ '@sentry/cli-darwin': 3.3.0
+ '@sentry/cli-linux-arm': 3.3.0
+ '@sentry/cli-linux-arm64': 3.3.0
+ '@sentry/cli-linux-i686': 3.3.0
+ '@sentry/cli-linux-x64': 3.3.0
+ '@sentry/cli-win32-arm64': 3.3.0
+ '@sentry/cli-win32-i686': 3.3.0
+ '@sentry/cli-win32-x64': 3.3.0
+
+ '@sentry/[email protected]': {}
+
+ dependencies:
+ '@sentry/babel-plugin-component-annotate': 5.1.1
+ '@sentry/browser': 10.42.0
+ '@sentry/cli': 3.3.0
+ '@sentry/core': 10.42.0
+ '@sentry/react': 10.42.0([email protected])
+ '@sentry/types': 10.42.0
+ react: 19.2.3
+ react-native: 0.81.5(@babel/[email protected])(@types/[email protected])([email protected])
+ optionalDependencies:
+
+ dependencies:
+ '@sentry/browser': 10.42.0
+ '@sentry/core': 10.42.0
+ react: 19.2.3
+
+ '@sentry/[email protected]':
+ dependencies:
+ '@sentry/core': 10.42.0
+
dependencies:
'@babel/runtime': 7.28.4
@@ -27023,10 +27223,7 @@ snapshots:
-
- optional: true
@@ -30661,6 +30858,8 @@ snapshots:
forwarded: 0.2.0
ipaddr.js: 1.9.1
+
dependencies:
punycode: 2.3.1
@@ -31845,7 +32044,7 @@ snapshots:
dependencies:
- '@babel/code-frame': 7.27.1
+ '@babel/code-frame': 7.29.0
jest-worker: 26.6.2
rollup: 2.79.2
serialize-javascript: 4.0.0
@@ -33212,6 +33411,8 @@ snapshots:
+
@@ -33994,7 +34195,7 @@ snapshots:
dependencies:
- isexe: 3.1.1
+ isexe: 3.1.5