Skip to content

Commit 965365f

Browse files
committed
update dependencies section
1 parent 2a8b6e3 commit 965365f

File tree

1 file changed

+34
-25
lines changed

1 file changed

+34
-25
lines changed

src/connections/auto-instrumentation/kotlin-setup.md

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,48 @@ Signals supports [Jetpack Compose](https://developer.android.com/compose){:targe
2626

2727
Segment recommends testing in a development environment before deploying Signals in production. For more information, see [Debug mode](#debug-mode).
2828

29+
## Step 1: Install dependencies
2930

30-
<!-->
31-
## Step 1: Add a source and get its write key
31+
To install Signals, add the following dependencies to your app-level Gradle build file.
3232

33-
You'll first need to add a source and copy its write key:
33+
```groovy
34+
dependencies {
35+
// Core Analytics Kotlin library
36+
implementation("com.segment.analytics.kotlin:android:1.19.1")
3437
35-
1. In your Segment workspace, navigate to **Connections > Auto-Instrumentation** and click **Add source**.
36-
2. Select a source, give the source a name, and click **Save**.
37-
3. Return to **Connections > Sources** to view your sources.
38-
4. In the **My sources** table, find and click the new source you just set up.
39-
5. In the **Initialize the Client** section, look for and copy the `writeKey` displayed in the code block.
38+
// Live plugin for real-time analytics
39+
implementation("com.segment.analytics.kotlin:analytics-kotlin-live:1.1.0")
4040
41-
## Step 2: Add dependencies and initialization code
41+
// Signals core library
42+
implementation("com.segment.analytics.kotlin.signals:core:0.5.0")
4243
43-
Next, you'll need to add the Signals SDKs to your Kotlin application.
44+
// Optional: Jetpack Compose UI tracking
45+
implementation("com.segment.analytics.kotlin.signals:compose:0.5.0")
4446
45-
1. Update your module’s Gradle build file to add the right dependencies:
47+
// Optional: OkHttp3 network request tracking
48+
implementation("com.segment.analytics.kotlin.signals:okhttp3:0.5.0")
4649
47-
```kotlin
48-
dependencies {
49-
// Add the Analytics Kotlin library
50-
implementation("com.segment.analytics.kotlin:android:1.15.0")
51-
// Add a live plugin for real-time data handling
52-
implementation("com.segment.analytics.kotlin:analytics-kotlin-live:1.0.0")
53-
// Add the core Signals library
54-
implementation("com.segment.analytics.kotlin.signals:core:0.0.1")
55-
// Compose plugin for Jetpack Compose UI tracking
56-
implementation("com.segment.analytics.kotlin.signals:compose:0.0.1")
57-
// OkHttp3 plugin for network activity tracking
58-
implementation("com.segment.analytics.kotlin.signals:okhttp3:0.0.1")
59-
}
60-
```
50+
// Optional: Screen and route tracking for Navigation components
51+
implementation("com.segment.analytics.kotlin.signals:navigation:0.5.0")
52+
53+
// Optional: HttpURLConnection tracking
54+
implementation("com.segment.analytics.kotlin.signals:java-net:0.5.0")
55+
}
56+
```
57+
58+
The core libraries are required to enable Signals and real-time analytics. Use the optional plugins to track additional activity based on your app's architecture:
59+
60+
- Compose plugin, which tracks user interface events in Jetpack Compose.
61+
- OkHttp3 plugin, which captures requests sent through OkHttp3 or Retrofit.
62+
- Navigation plugin, which tracks route changes when using Jetpack Navigation.
63+
- JavaNet plugin, which tracks network activity sent through `HttpURLConnection`.
6164

65+
Only add the plugins you plan to use. You can add or remove them later without reinitializing your source.
66+
67+
68+
69+
70+
<!-->
6271
2. Add the initialization code and configuration options:
6372

6473
> success ""

0 commit comments

Comments
 (0)