You need:
- nodejs 22 or higher (with corepack enabled)
- yarn 1 or higher
- yalc (can be installed with
yarn global add yalc) - http-server
- ionic
First install dependencies of the SDK (the root of the repository) This is only needed if dependencies are added/removed.
yarnOnce deps are installed, you can build the project:
yarn build
# Or in watch mode, for development
yarn watch- Go to android/build.gradle and update the version of
io.sentry:sentry-android.
- Basically you'll need to edit SentryCapacitor.podspec and ios/Porfile updating the Sentry dependency and validate it on one of the examples apps on this project.
- Run 'pod install --repo-update' on the ios folder and then 'yarn build' on the root folder.
- You can use the following script
yarn bump:javascript-version versionto bump Sentry JavaScript to the version you desire, this will bump the root package and also the sample apps. For example, if you want to update it to version10.40.0, You should run the following scriptyarn bump:javascript-version 10.40.0.
We use yalc to serve the local package builds to our example apps. You can run the bump scripts such as bump:v3 to package the SDK and sync the latest version to the example apps.
See the readmes in the specific example app folders for individual instructions:
In order to test Spotlight, modify the file environment.local.ts or local.ts from the sample apps with the following value:
export const localConfig = {
spotlightSidecarUrl: 'http://IP:8969/stream', // replace IP by your local IP.
};If the file is not present on your sample app, it will be automatically generated on the first build from the sample app.
For running Spotlight, please check the website https://github.com/getsentry/spotlight/releases and download the latest @spotlightjs/sidecar.
NOTE: When testing spotlight on a device that is not the physical device where spotlight server is running, don't forget to expose the port 8969 for TCP.
yarn test
# Or the watcher when writing tests:
yarn test:watchWe'd love for users to update the SDK everytime and as soon as we make a new release. But in reality most users rarely update the SDK. To help users see value in updating the SDK, we maintain a changelog file with entries split between two headings:
### Features### Fixes
We add the heading in the first PR that's adding either a feature or fixes in the current release. After a release, the changelog file will contain only the last release entries.
When you open a PR in such case, you need to add a heading 2 named ## Unreleased, which is replaced during release with the version number chosen.
Below that, you'll add the heading 3 mentioned above. For example, if you're adding a feature "Attach screenshots when capturing errors on iOS", right after a release, and the pull request number is 123, you'd add to the changelog:
## Unreleased
### Features
* Attach screenshots when capturing errors on iOS ([#123](https://github.com/getsentry/sentry-capacitor/pull/123))
There's a GitHub action check to verify if an entry was added. If the entry isn't a user-facing change, you can skip the verification with #skip-changelog written to the PR description. The bot writes a comment in the PR with a suggestion entry to the changelog based on the PR title.
Here are step on how to test your changes in sentry-cocoa with sentry-capacitor. We assume you have both repositories cloned in siblings folders.
- Build
sentry-cocoa.
cd sentry-cocoa
make init
make build-xcframework- Link local
sentry-cocoabuild insentry-capacitor
cd sentry-capacitorComment out sentry dependency in SentryCapacitor.podspec.
- s.dependency 'Sentry', '7.31.0'
+ # s.dependency 'Sentry', '7.31.0'Add local pods to example/ionic-angular/ios/App/Podfile.
target 'sample' do
# ... capacitor config
+ pod 'Sentry/HybridSDK', :path => '../../../sentry-cocoa'
+ pod 'SentryPrivate', :path => '../../../sentry-cocoa/SentryPrivate.podspec'
# ... rest of the configuration
endHere are step on how to test your changes in sentry-java with sentry-capacitor. We assume that you have sentry-java setup, Android SDK installed, correct JAVA version etc.
- Build and publish
sentry-javalocally.
cd sentry-java
make dryRelease
ls ~/.m2/repository/io/sentry/sentry-android # check that `sentry-java` was published- Add local maven to the sample project.
cd sentry-capacitor/exampleAdd local maven to example/sample-project/android/build.gradle.
allprojects {
repositories {
+ mavenLocal()Update sentry-android version, to the one locally published, in android/build.gradle.
dependencies {
implementation project(':capacitor-android')+'
- implementation 'io.sentry:sentry-android:5.4.0'
+ implementation 'io.sentry:sentry-android:6.7.7-my-local-version'
}When bumping the dependency of Capacitor, always have a look on the following link to see any changes required on the SDK in order to support the latest versions of Capacitor: https://capacitorjs.com/docs/updating/plugins/6-0