Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
README.md 897 B
Newer Older
# Telemetry

Wrapper for Sentry to use in /e/ OS default applications.

## Usage

- First, we need to add dependency repository to `settings.gradle`:

```groovy
maven("https://gitlab.e.foundation/api/v4/groups/1391/-/packages/maven")
```

- Then, we need to add dependency to `build.gradle`:

```groovy
implementation 'foundation.e.lib:telemetry:0.0.6-alpha'
```

- Get the Sentry DSN from the sentry dashboard and add the following to `build.gradle`:

```groovy
buildTypes {
    configureEach {
        buildConfigField("String", "SENTRY_DSN", "\"${System.getenv("SENTRY_DSN")}\"")
    }
}
```

- To use the library, we need to add the following code to the main `Application` class:

```kotlin
Telemetry.init(BuildConfig.SENTRY_DSN, this)
```

- To send an event, we need to add the following code:

```kotlin
Telemetry.reportMessage("sample message")
```