vybekiit 0.7.34 → 0.7.35

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 (121) hide show
  1. package/dist/bin.js +520 -9
  2. package/dist/global-skills/eas-app-stores/SKILL.md +2 -2
  3. package/dist/global-skills/eas-hosting/SKILL.md +2 -2
  4. package/dist/global-skills/eas-observe/SKILL.md +7 -15
  5. package/dist/global-skills/eas-observe/references/queries.md +51 -10
  6. package/dist/global-skills/eas-observe/references/setup.md +60 -7
  7. package/dist/global-skills/eas-simulator/SKILL.md +2 -2
  8. package/dist/global-skills/eas-simulator/references/run-your-app.md +2 -0
  9. package/dist/global-skills/eas-update/SKILL.md +2 -2
  10. package/dist/global-skills/eas-update-insights/SKILL.md +2 -2
  11. package/dist/global-skills/eas-workflows/SKILL.md +2 -2
  12. package/dist/global-skills/expo-animation/SKILL.md +2 -2
  13. package/dist/global-skills/expo-app-clip/SKILL.md +2 -2
  14. package/dist/global-skills/expo-brownfield/SKILL.md +2 -2
  15. package/dist/global-skills/expo-data-fetching/SKILL.md +2 -2
  16. package/dist/global-skills/expo-design-system/SKILL.md +2 -2
  17. package/dist/global-skills/expo-dev-client/SKILL.md +4 -2
  18. package/dist/global-skills/expo-dom/SKILL.md +2 -2
  19. package/dist/global-skills/expo-examples/SKILL.md +2 -2
  20. package/dist/global-skills/expo-migrate-module/SKILL.md +2 -2
  21. package/dist/global-skills/expo-module/SKILL.md +2 -2
  22. package/dist/global-skills/expo-native-ui/SKILL.md +2 -2
  23. package/dist/global-skills/expo-overview/SKILL.md +9 -4
  24. package/dist/global-skills/expo-overview/references/launch-without-dev-menu.md +24 -0
  25. package/dist/global-skills/expo-project-structure/SKILL.md +2 -2
  26. package/dist/global-skills/expo-router/SKILL.md +2 -2
  27. package/dist/global-skills/expo-ui/SKILL.md +2 -2
  28. package/dist/global-skills/expo-upgrade/SKILL.md +2 -2
  29. package/dist/global-skills/expo-web-to-native/SKILL.md +2 -2
  30. package/dist/global-skills/expo-web-to-native/references/verify-on-device.md +1 -1
  31. package/dist/global-skills/firebase-app-hosting-basics/SKILL.md +16 -3
  32. package/dist/global-skills/firebase-app-hosting-basics/references/cli_commands.md +10 -12
  33. package/dist/global-skills/firebase-app-hosting-basics/references/configuration.md +2 -1
  34. package/dist/global-skills/firebase-basics/SKILL.md +6 -4
  35. package/dist/global-skills/firebase-basics/references/web_setup.md +3 -3
  36. package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +81 -333
  37. package/dist/global-skills/instrument-feature-flags/references/android.md +19 -13
  38. package/dist/global-skills/instrument-feature-flags/references/api.md +17 -13
  39. package/dist/global-skills/instrument-feature-flags/references/best-practices.md +35 -35
  40. package/dist/global-skills/instrument-feature-flags/references/django.md +120 -72
  41. package/dist/global-skills/instrument-feature-flags/references/dotnet.md +48 -102
  42. package/dist/global-skills/instrument-feature-flags/references/elixir.md +4 -10
  43. package/dist/global-skills/instrument-feature-flags/references/flask.md +55 -39
  44. package/dist/global-skills/instrument-feature-flags/references/flutter.md +19 -13
  45. package/dist/global-skills/instrument-feature-flags/references/go.md +21 -13
  46. package/dist/global-skills/instrument-feature-flags/references/ios.md +19 -13
  47. package/dist/global-skills/instrument-feature-flags/references/java.md +4 -12
  48. package/dist/global-skills/instrument-feature-flags/references/laravel.md +18 -16
  49. package/dist/global-skills/instrument-feature-flags/references/next-js.md +44 -54
  50. package/dist/global-skills/instrument-feature-flags/references/nodejs.md +21 -13
  51. package/dist/global-skills/instrument-feature-flags/references/php.md +21 -13
  52. package/dist/global-skills/instrument-feature-flags/references/python.md +22 -14
  53. package/dist/global-skills/instrument-feature-flags/references/react-native.md +18 -13
  54. package/dist/global-skills/instrument-feature-flags/references/react.md +21 -14
  55. package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +31 -68
  56. package/dist/global-skills/instrument-feature-flags/references/ruby.md +21 -13
  57. package/dist/global-skills/instrument-feature-flags/references/rust.md +10 -34
  58. package/dist/global-skills/instrument-feature-flags/references/usage.md +94 -114
  59. package/dist/global-skills/instrument-feature-flags/references/web.md +21 -13
  60. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-android.md +7 -7
  61. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-expo.md +2 -2
  62. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-fastapi.md +1 -1
  63. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-flask.md +1 -1
  64. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-laravel.md +2 -2
  65. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-php.md +1 -1
  66. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-python.md +1 -1
  67. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby.md +1 -1
  68. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-swift.md +4 -4
  69. package/dist/global-skills/instrument-product-analytics/references/android.md +64 -109
  70. package/dist/global-skills/instrument-product-analytics/references/angular.md +32 -28
  71. package/dist/global-skills/instrument-product-analytics/references/astro.md +29 -34
  72. package/dist/global-skills/instrument-product-analytics/references/configuration.md +27 -42
  73. package/dist/global-skills/instrument-product-analytics/references/django.md +120 -72
  74. package/dist/global-skills/instrument-product-analytics/references/dotnet.md +48 -102
  75. package/dist/global-skills/instrument-product-analytics/references/elixir.md +25 -50
  76. package/dist/global-skills/instrument-product-analytics/references/flask.md +55 -39
  77. package/dist/global-skills/instrument-product-analytics/references/flutter.md +94 -96
  78. package/dist/global-skills/instrument-product-analytics/references/go.md +39 -77
  79. package/dist/global-skills/instrument-product-analytics/references/identify-users.md +24 -26
  80. package/dist/global-skills/instrument-product-analytics/references/ios.md +22 -22
  81. package/dist/global-skills/instrument-product-analytics/references/laravel.md +18 -16
  82. package/dist/global-skills/instrument-product-analytics/references/next-js.md +44 -54
  83. package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +32 -34
  84. package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +36 -36
  85. package/dist/global-skills/instrument-product-analytics/references/php.md +42 -87
  86. package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +15 -12
  87. package/dist/global-skills/instrument-product-analytics/references/python.md +106 -154
  88. package/dist/global-skills/instrument-product-analytics/references/react-native.md +97 -176
  89. package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +29 -40
  90. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +29 -38
  91. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +29 -40
  92. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +32 -37
  93. package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +31 -68
  94. package/dist/global-skills/instrument-product-analytics/references/ruby.md +40 -96
  95. package/dist/global-skills/instrument-product-analytics/references/svelte.md +34 -34
  96. package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +19 -19
  97. package/dist/global-skills/instrument-product-analytics/references/usage.md +94 -114
  98. package/dist/global-skills/instrument-product-analytics/references/vue-js.md +33 -45
  99. package/dist/global-skills/mongodb-search-and-ai/SKILL.md +40 -22
  100. package/dist/global-skills/mongodb-search-and-ai/references/automated-embedding.md +8 -2
  101. package/dist/global-skills/mongodb-search-and-ai/references/quick-start.md +725 -0
  102. package/dist/global-skills/mongodb-search-and-ai/scripts/quickstart_complete.py +386 -0
  103. package/dist/global-skills/neon/references/claimable-neon.md +2 -0
  104. package/dist/global-skills/neon-realtime/references/queries.md +2 -2
  105. package/dist/global-skills/resend/SKILL.md +1 -1
  106. package/dist/global-skills/resend/references/inboxes.md +49 -21
  107. package/dist/global-skills/resend/references/webhooks.md +1 -1
  108. package/dist/global-skills/stripe-best-practices/SKILL.md +1 -1
  109. package/dist/global-skills/stripe-best-practices/references/connect.md +1 -1
  110. package/dist/global-skills/stripe-best-practices/references/security.md +9 -9
  111. package/dist/global-skills/vybekiitReferences/backend/AGENTS.md +1 -1
  112. package/dist/global-skills/vybekiitReferences/backend/agent/goal-routes.json +303 -18
  113. package/dist/global-skills/vybekiitReferences/extension/AGENTS.md +1 -1
  114. package/dist/global-skills/vybekiitReferences/extension/agent/goal-routes.json +352 -18
  115. package/dist/global-skills/vybekiitReferences/mobile/AGENTS.md +1 -1
  116. package/dist/global-skills/vybekiitReferences/mobile/agent/goal-routes.json +413 -22
  117. package/dist/global-skills/vybekiitReferences/spa/AGENTS.md +1 -1
  118. package/dist/global-skills/vybekiitReferences/spa/agent/goal-routes.json +391 -21
  119. package/dist/global-skills/vybekiitReferences/web/AGENTS.md +14 -2
  120. package/dist/global-skills/vybekiitReferences/web/agent/goal-routes.json +490 -32
  121. package/package.json +8 -8
@@ -195,7 +195,7 @@ The `/api/test-error` endpoint demonstrates manual exception capture. Use `?capt
195
195
  ## Project Structure
196
196
 
197
197
  ```
198
- basics/laravel/
198
+ example-apps/laravel/
199
199
  ├── app/
200
200
  │ ├── Http/
201
201
  │ │ ├── Controllers/
@@ -1251,7 +1251,7 @@ This document summarizes the implementation of the Laravel PostHog example appli
1251
1251
  ## 📁 File Structure
1252
1252
 
1253
1253
  ```
1254
- basics/laravel/
1254
+ example-apps/laravel/
1255
1255
  ├── app/
1256
1256
  │ ├── Http/
1257
1257
  │ │ ├── Controllers/
@@ -80,7 +80,7 @@ The app tracks these events in PostHog:
80
80
  ## Code Structure
81
81
 
82
82
  ```
83
- basics/php/
83
+ example-apps/php/
84
84
  ├── todo.php # Main CLI application
85
85
  ├── composer.json # PHP dependencies
86
86
  ├── .env.example # Environment variable template
@@ -85,7 +85,7 @@ The app tracks these events in PostHog:
85
85
  ## Code Structure
86
86
 
87
87
  ```
88
- basics/python/
88
+ example-apps/python/
89
89
  ├── todo.py # Main CLI application
90
90
  ├── requirements.txt # Python dependencies
91
91
  ├── .env.example # Environment variable template
@@ -83,7 +83,7 @@ The app tracks these events in PostHog:
83
83
  ## Code Structure
84
84
 
85
85
  ```
86
- basics/ruby/
86
+ example-apps/ruby/
87
87
  ├── todo.rb # Main CLI application
88
88
  ├── Gemfile # Ruby dependencies
89
89
  ├── .env.example # Environment variable template
@@ -61,7 +61,7 @@ import PostHog
61
61
 
62
62
  // The project token is a public client-side key, so it's safe to ship in the
63
63
  // binary. Replace the placeholder with your token from the PostHog project settings.
64
- let config = PostHogConfig(apiKey: "<your-project-token>", host: "https://us.i.posthog.com")
64
+ let config = PostHogConfig(projectToken: "<your-project-token>", host: "https://us.i.posthog.com")
65
65
  config.captureApplicationLifecycleEvents = true
66
66
  PostHogSDK.shared.setup(config)
67
67
  ```
@@ -143,8 +143,8 @@ PostHogSDK.shared.reset()
143
143
  "kind" : "remoteSourceControl",
144
144
  "location" : "https://github.com/PostHog/posthog-ios",
145
145
  "state" : {
146
- "revision" : "1783865d79a1cabc472cf2d56a1fe3f797417b52",
147
- "version" : "3.40.0"
146
+ "revision" : "835f624c2618d72d73650d0ed0029325232f5b0a",
147
+ "version" : "3.92.0"
148
148
  }
149
149
  }
150
150
  ],
@@ -280,7 +280,7 @@ struct BurritoConsiderationClientApp: App {
280
280
  @State private var userState = UserState()
281
281
 
282
282
  init() {
283
- let config = PostHogConfig(apiKey: posthogProjectToken, host: posthogHost)
283
+ let config = PostHogConfig(projectToken: posthogProjectToken, host: posthogHost)
284
284
  config.captureApplicationLifecycleEvents = true
285
285
  config.debug = true
286
286
  PostHogSDK.shared.setup(config)
@@ -2,6 +2,37 @@
2
2
 
3
3
  # Android
4
4
 
5
+ Canonical URL: https://posthog.com/docs/libraries/android
6
+
7
+ > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://us.posthog.com` (app host for links).
8
+
9
+ ## On this page
10
+
11
+ - [Installation](#installation)
12
+ - [Capturing events](#capturing-events)
13
+ - [Identifying users](#identifying-users)
14
+ - [Get the current user's distinct ID](#get-the-current-users-distinct-id)
15
+ - [Tracing headers](#tracing-headers)
16
+ - [Alias](#alias)
17
+ - [Anonymous and identified events](#anonymous-and-identified-events)
18
+ - [Setting person properties](#setting-person-properties)
19
+ - [Super Properties](#super-properties)
20
+ - [Opt out of data capture](#opt-out-of-data-capture)
21
+ - [Flush](#flush)
22
+ - [Reset after logout](#reset-after-logout)
23
+ - [Feature Flags](#feature-flags)
24
+ - [Experiments (A/B tests)](#experiments-ab-tests)
25
+ - [Group analytics](#group-analytics)
26
+ - [Error tracking](#error-tracking)
27
+ - [Logs](#logs)
28
+ - [Session replay](#session-replay)
29
+ - [Surveys](#surveys)
30
+ - [Offline behavior](#offline-behavior)
31
+ - [Debug mode](#debug-mode)
32
+ - [All configuration options](#all-configuration-options)
33
+ - [What Android API level is required?](#what-android-api-level-is-required)
34
+ - [Do I need to declare permissions in the AndroidManifest.xml?](#do-i-need-to-declare-permissions-in-the-androidmanifestxml)
35
+
5
36
  It uses an internal queue to make calls fast and non-blocking. It also batches requests and flushes asynchronously, making it perfect to use in any part of your mobile app.
6
37
 
7
38
  ## Installation
@@ -30,8 +61,6 @@ dependencies {
30
61
 
31
62
  The best place to initialize the client is in your `Application` subclass.
32
63
 
33
- Kotlin
34
-
35
64
  ```kotlin
36
65
  import android.app.Application
37
66
  import com.posthog.android.PostHogAndroid
@@ -61,8 +90,6 @@ class SampleApp : Application() {
61
90
 
62
91
  You can send custom events using `capture`:
63
92
 
64
- Kotlin
65
-
66
93
  ```kotlin
67
94
  import com.posthog.PostHog
68
95
 
@@ -73,9 +100,7 @@ PostHog.capture(event = "user_signed_up")
73
100
 
74
101
  ### Setting event properties
75
102
 
76
- Optionally, you can include additional information with the event by including a [properties](/docs/data/events.md#event-properties) object:
77
-
78
- Kotlin
103
+ Optionally, you can include additional information with the event by including a [properties](https://posthog.com/docs/data/events.md#event-properties) object:
79
104
 
80
105
  ```kotlin
81
106
  import com.posthog.PostHog
@@ -99,16 +124,14 @@ PostHog autocapture automatically tracks the following events for you:
99
124
  - **Application Installed** - when the app is installed.
100
125
  - **Application Updated** - when the app is updated.
101
126
  - **$screen** - when the user navigates. (if using `android.app.Activity`)
102
- - **$exception** - when uncaught exception autocapture is enabled. To use this, enable [Android error tracking](/docs/error-tracking/installation/android.md) and exception autocapture in the SDK config.
127
+ - **$exception** - when uncaught exception autocapture is enabled. To use this, enable [Android error tracking](https://posthog.com/docs/error-tracking/installation/android.md) and exception autocapture in the SDK config.
103
128
 
104
129
  ### Capturing screen views
105
130
 
106
- With [`captureScreenViews = true`](/docs/libraries/android.md#all-configuration-options), PostHog will try to record all screen changes automatically.
131
+ With [`captureScreenViews = true`](https://posthog.com/docs/libraries/android.md#all-configuration-options), PostHog will try to record all screen changes automatically.
107
132
 
108
133
  The `screenTitle` will be the [`<activity>`](https://developer.android.com/guide/topics/manifest/activity-element)'s `android:label`, if not set it'll fallback to the [`<application>`](https://developer.android.com/guide/topics/manifest/application-element)'s `android:label` or the [`<activity>`](https://developer.android.com/guide/topics/manifest/activity-element)'s `android:name`.
109
134
 
110
- XML
111
-
112
135
  ```xml
113
136
  <activity
114
137
  android:name="com.example.app.ChildActivity"
@@ -121,8 +144,6 @@ If you want to manually send a new screen capture event, use the `screen` functi
121
144
 
122
145
  This function requires a `screenTitle`. You may also pass in an optional `properties` object.
123
146
 
124
- Kotlin
125
-
126
147
  ```kotlin
127
148
  import com.posthog.PostHog
128
149
 
@@ -137,17 +158,15 @@ PostHog.screen(
137
158
 
138
159
  ## Identifying users
139
160
 
140
- > We highly recommend reading our section on [Identifying users](/docs/integrate/identifying-users.md) to better understand how to correctly use this method.
161
+ > We highly recommend reading our section on [Identifying users](https://posthog.com/docs/integrate/identifying-users.md) to better understand how to correctly use this method.
141
162
 
142
163
  Using `identify`, you can associate events with specific users. This enables you to gain full insights as to how they're using your product across different sessions, devices, and platforms.
143
164
 
144
165
  An `identify` call has the following arguments:
145
166
 
146
167
  - **distinctId:** Required. A unique identifier for your user. Typically either their email or database ID.
147
- - **userProperties:** Optional. A dictionary with key:value pairs to set the [person properties](/docs/product-analytics/person-properties.md)
148
- - **userPropertiesSetOnce:** Optional. Similar to `userProperties`. [See the difference between `userProperties` and `userPropertiesSetOnce`](/docs/product-analytics/person-properties.md#what-is-the-difference-between-set-and-set_once)
149
-
150
- Kotlin
168
+ - **userProperties:** Optional. A dictionary with key:value pairs to set the [person properties](https://posthog.com/docs/product-analytics/person-properties.md)
169
+ - **userPropertiesSetOnce:** Optional. Similar to `userProperties`. [See the difference between `userProperties` and `userPropertiesSetOnce`](https://posthog.com/docs/product-analytics/person-properties.md#what-is-the-difference-between-set-and-set_once)
151
170
 
152
171
  ```kotlin
153
172
  import com.posthog.PostHog
@@ -178,8 +197,6 @@ To do this, call `distinctId()`. This returns either the ID automatically genera
178
197
 
179
198
  Use `tracingHeaders` to connect Android network requests to backend events, errors, and LLM traces captured by a server-side PostHog SDK. Tracing headers are added by the `PostHogOkHttpInterceptor`, so install the interceptor on each `OkHttpClient` whose requests should include PostHog context.
180
199
 
181
- Kotlin
182
-
183
200
  ```kotlin
184
201
  import com.posthog.PostHogOkHttpInterceptor
185
202
  import com.posthog.android.PostHogAndroid
@@ -208,8 +225,6 @@ Sometimes, you want to assign multiple distinct IDs to a single user. This is he
208
225
 
209
226
  In this case, you can use `alias` to assign another distinct ID to the same user.
210
227
 
211
- Kotlin
212
-
213
228
  ```kotlin
214
229
  /**
215
230
  * Create an alias for the current user.
@@ -217,13 +232,13 @@ Kotlin
217
232
  PostHog.alias("distinct_id")
218
233
  ```
219
234
 
220
- We strongly recommend reading our docs on [alias](/docs/product-analytics/identify.md#alias-assigning-multiple-distinct-ids-to-the-same-user) to best understand how to correctly use this method.
235
+ We strongly recommend reading our docs on [alias](https://posthog.com/docs/product-analytics/identify.md#alias-assigning-multiple-distinct-ids-to-the-same-user) to best understand how to correctly use this method.
221
236
 
222
237
  ## Anonymous and identified events
223
238
 
224
- PostHog captures two types of events: [**anonymous** and **identified**](/docs/data/anonymous-vs-identified-events.md)
239
+ PostHog captures two types of events: [**anonymous** and **identified**](https://posthog.com/docs/data/anonymous-vs-identified-events.md)
225
240
 
226
- **Identified events** enable you to attribute events to specific users, and attach [person properties](/docs/product-analytics/person-properties.md). They're best suited for logged-in users.
241
+ **Identified events** enable you to attribute events to specific users, and attach [person properties](https://posthog.com/docs/product-analytics/person-properties.md). They're best suited for logged-in users.
227
242
 
228
243
  Scenarios where you want to capture identified events are:
229
244
 
@@ -231,7 +246,7 @@ Scenarios where you want to capture identified events are:
231
246
  - Doing user segmented product analysis
232
247
  - Growth and marketing teams wanting to analyze the *complete* conversion lifecycle
233
248
 
234
- **Anonymous events** are events without individually identifiable data. They're best suited for [web analytics](/docs/web-analytics.md) or apps where users aren't logged in.
249
+ **Anonymous events** are events without individually identifiable data. They're best suited for [web analytics](https://posthog.com/docs/web-analytics.md) or apps where users aren't logged in.
235
250
 
236
251
  Scenarios where you want to capture anonymous events are:
237
252
 
@@ -239,15 +254,15 @@ Scenarios where you want to capture anonymous events are:
239
254
  - Content-focused sites
240
255
  - B2C apps where users don't sign up or log in
241
256
 
242
- Under the hood, the key difference between identified and anonymous events is that for identified events we create a [person profile](/docs/data/persons.md) for the user, whereas for anonymous events we do not.
257
+ Under the hood, the key difference between identified and anonymous events is that for identified events we create a [person profile](https://posthog.com/docs/data/persons.md) for the user, whereas for anonymous events we do not.
243
258
 
244
259
  > **Important:** Due to the reduced cost of processing them, anonymous events can be up to 4x cheaper than identified ones, so we recommended you only capture identified events when needed.
245
260
 
246
261
  ### How to capture anonymous events
247
262
 
248
- The Android SDK captures anonymous events by default. However, this may change depending on your `personProfiles` [config](/docs/libraries/android.md#all-configuration-options) when initializing PostHog:
263
+ The Android SDK captures anonymous events by default. However, this may change depending on your `personProfiles` [config](https://posthog.com/docs/libraries/android.md#all-configuration-options) when initializing PostHog:
249
264
 
250
- 1. `personProfiles = PersonProfiles.IDENTIFIED_ONLY` *(recommended)* *(default)* - Anonymous events are captured by default. PostHog only captures identified events for users where [person profiles](/docs/data/persons.md) have already been created.
265
+ 1. `personProfiles = PersonProfiles.IDENTIFIED_ONLY` *(recommended)* *(default)* - Anonymous events are captured by default. PostHog only captures identified events for users where [person profiles](https://posthog.com/docs/data/persons.md) have already been created.
251
266
 
252
267
  2. `personProfiles = PersonProfiles.ALWAYS` - Capture identified events for all events.
253
268
 
@@ -255,8 +270,6 @@ The Android SDK captures anonymous events by default. However, this may change d
255
270
 
256
271
  For example:
257
272
 
258
- Kotlin
259
-
260
273
  ```kotlin
261
274
  val config = PostHogAndroidConfig(
262
275
  apiKey = POSTHOG_API_KEY,
@@ -268,24 +281,22 @@ val config = PostHogAndroidConfig(
268
281
 
269
282
  ### How to capture identified events
270
283
 
271
- If you've set the [`personProfiles` config](/docs/libraries/android.md#all-configuration-options) to `IDENTIFIED_ONLY` (the default option), anonymous events are captured by default. Then, to capture identified events, call any of the following functions:
284
+ If you've set the [`personProfiles` config](https://posthog.com/docs/libraries/android.md#all-configuration-options) to `IDENTIFIED_ONLY` (the default option), anonymous events are captured by default. Then, to capture identified events, call any of the following functions:
272
285
 
273
- - [`identify()`](/docs/product-analytics/identify.md)
274
- - [`alias()`](/docs/product-analytics/identify.md#alias-assigning-multiple-distinct-ids-to-the-same-user)
275
- - [`group()`](/docs/product-analytics/group-analytics.md)
286
+ - [`identify()`](https://posthog.com/docs/product-analytics/identify.md)
287
+ - [`alias()`](https://posthog.com/docs/product-analytics/identify.md#alias-assigning-multiple-distinct-ids-to-the-same-user)
288
+ - [`group()`](https://posthog.com/docs/product-analytics/group-analytics.md)
276
289
 
277
- When you call any of these functions, it creates a [person profile](/docs/data/persons.md) for the user. Once this profile is created, all subsequent events for this user will be captured as identified events.
290
+ When you call any of these functions, it creates a [person profile](https://posthog.com/docs/data/persons.md) for the user. Once this profile is created, all subsequent events for this user will be captured as identified events.
278
291
 
279
292
  Alternatively, you can set `personProfiles` to `ALWAYS` to capture identified events by default.
280
293
 
281
294
  ## Setting person properties
282
295
 
283
- To set [properties](/docs/product-analytics/person-properties.md) on your users via an event, you can leverage the event properties `userProperties` and `userPropertiesSetOnce`.
296
+ To set [properties](https://posthog.com/docs/product-analytics/person-properties.md) on your users via an event, you can leverage the event properties `userProperties` and `userPropertiesSetOnce`.
284
297
 
285
298
  When capturing an event, you can pass a property called `userProperties` as an event property, and specify its value to be an object with properties to be set on the user that will be associated with the user who triggered the event.
286
299
 
287
- Kotlin
288
-
289
300
  ```kotlin
290
301
  import com.posthog.PostHog
291
302
 
@@ -301,8 +312,6 @@ PostHog.capture(
301
312
 
302
313
  `userPropertiesSetOnce` works just like `userProperties`, except that it will **only set the property if the user doesn't already have that property set**.
303
314
 
304
- Kotlin
305
-
306
315
  ```kotlin
307
316
  import com.posthog.PostHog
308
317
 
@@ -324,8 +333,6 @@ They are set using `PostHog.register`, which takes a key and value, and they per
324
333
 
325
334
  For example, take a look at the following call:
326
335
 
327
- Kotlin
328
-
329
336
  ```kotlin
330
337
  import com.posthog.PostHog
331
338
 
@@ -340,8 +347,6 @@ However, please note that this does not store properties against the User, only
340
347
 
341
348
  Super Properties are persisted across sessions so you have to explicitly remove them if they are no longer relevant. In order to stop sending a Super Property with events, you can use `PostHog.unregister`, like so:
342
349
 
343
- Kotlin
344
-
345
350
  ```kotlin
346
351
  import com.posthog.PostHog
347
352
 
@@ -358,8 +363,6 @@ You can completely opt-out users from data capture. To do this, there are two op
358
363
 
359
364
  1. Opt users out by default by setting `optOut` to `true` in your PostHog config:
360
365
 
361
- Kotlin
362
-
363
366
  ```kotlin
364
367
  val config = PostHogAndroidConfig(
365
368
  apiKey = "<ph_project_token>",
@@ -371,24 +374,18 @@ PostHogAndroid.setup(this, config)
371
374
 
372
375
  2. Opt users out on a per-person basis by calling `optOut()`:
373
376
 
374
- Kotlin
375
-
376
377
  ```kotlin
377
378
  PostHog.optOut()
378
379
  ```
379
380
 
380
381
  Similarly, you can opt users in:
381
382
 
382
- Kotlin
383
-
384
383
  ```kotlin
385
384
  PostHog.optIn()
386
385
  ```
387
386
 
388
387
  To check if a user is opted out:
389
388
 
390
- Kotlin
391
-
392
389
  ```kotlin
393
390
  PostHog.isOptOut()
394
391
  ```
@@ -399,8 +396,6 @@ You can configure how many events queue before flushing with `flushAt`. Setting
399
396
 
400
397
  You can also configure the flush interval with `flushIntervalSeconds` (default `30`), after which queued events are sent regardless of how many have been gathered:
401
398
 
402
- Kotlin
403
-
404
399
  ```kotlin
405
400
  import com.posthog.android.PostHogAndroidConfig
406
401
 
@@ -412,8 +407,6 @@ val config = PostHogAndroidConfig(apiKey = POSTHOG_API_KEY, host = POSTHOG_HOST)
412
407
 
413
408
  You can also manually flush the queue to start sending events immediately instead of waiting for the next batch:
414
409
 
415
- Kotlin
416
-
417
410
  ```kotlin
418
411
  import com.posthog.PostHog
419
412
 
@@ -426,8 +419,6 @@ Flushing is best-effort and asynchronous – it starts sending queued events in
426
419
 
427
420
  To reset the user's ID and anonymous ID, call `reset`. Usually you would do this right after the user logs out.
428
421
 
429
- Kotlin
430
-
431
422
  ```kotlin
432
423
  import com.posthog.PostHog
433
424
 
@@ -436,12 +427,10 @@ PostHog.reset()
436
427
 
437
428
  ## Feature Flags
438
429
 
439
- PostHog's [feature flags](/docs/feature-flags.md) enable you to safely deploy and roll back new features as well as target specific users and groups with them.
430
+ PostHog's [feature flags](https://posthog.com/docs/feature-flags.md) enable you to safely deploy and roll back new features as well as target specific users and groups with them.
440
431
 
441
432
  ### Boolean feature flags
442
433
 
443
- Kotlin
444
-
445
434
  ```kotlin
446
435
  import com.posthog.PostHog
447
436
 
@@ -456,8 +445,6 @@ if (result?.enabled == true) {
456
445
 
457
446
  ### Multivariate feature flags
458
447
 
459
- Kotlin
460
-
461
448
  ```kotlin
462
449
  import com.posthog.PostHog
463
450
 
@@ -474,8 +461,6 @@ if (result?.variant == "variant-key") { // replace "variant-key" with the key of
474
461
 
475
462
  You can inspect all currently loaded feature flags with `PostHog.getAllFeatureFlags()`. It returns each flag's `key`, `enabled` state, `variant`, and `payload`, and does not send a `$feature_flag_called` event, so calling it won't affect your experiment results or flag usage analytics:
476
463
 
477
- Kotlin
478
-
479
464
  ```kotlin
480
465
  import com.posthog.PostHog
481
466
 
@@ -492,8 +477,6 @@ This means that for most screens, the feature flags are available immediately
492
477
 
493
478
  To handle this, you can use the `onFeatureFlags` callback to wait for the feature flag request to finish:
494
479
 
495
- Kotlin
496
-
497
480
  ```kotlin
498
481
  import com.posthog.PostHog
499
482
  import com.posthog.android.PostHogAndroidConfig
@@ -520,8 +503,6 @@ PostHog.reloadFeatureFlags {
520
503
 
521
504
  Feature flag values are cached. If something has changed with your user and you'd like to refetch their flag values, call:
522
505
 
523
- Kotlin
524
-
525
506
  ```kotlin
526
507
  import com.posthog.PostHog
527
508
 
@@ -532,8 +513,6 @@ PostHog.reloadFeatureFlags()
532
513
 
533
514
  To track when someone sees or interacts with a feature, use `captureFeatureView` and `captureFeatureInteraction`.
534
515
 
535
- Kotlin
536
-
537
516
  ```kotlin
538
517
  import com.posthog.PostHog
539
518
 
@@ -549,8 +528,6 @@ To have your feature flags available immediately, you can initialize PostHog wit
549
528
 
550
529
  Set `config.bootstrap` before calling `setup()` to seed identity and flag values before the first `/flags` response (requires Android SDK `3.55.0`+):
551
530
 
552
- Kotlin
553
-
554
531
  ```kotlin
555
532
  import com.posthog.PostHogBootstrapConfig
556
533
 
@@ -573,13 +550,11 @@ PostHogAndroid.setup(this, config)
573
550
 
574
551
  The feature-flags-loaded signal fires as soon as bootstrapped flags are applied, so startup logic can read them immediately. These SDKs don't support the `sessionID` bootstrap option. When person profiles are set to `never`, the SDK preserves a different anonymous identity instead of merging it into an identified bootstrap.
575
552
 
576
- See the [SDK bootstrapping guide](/docs/libraries/bootstrapping.md) for the cross-SDK overview.
553
+ See the [SDK bootstrapping guide](https://posthog.com/docs/libraries/bootstrapping.md) for the cross-SDK overview.
577
554
 
578
555
  ## Experiments (A/B tests)
579
556
 
580
- Since [experiments](/docs/experiments/start-here.md) use feature flags, the code for running an experiment is very similar to the feature flags code:
581
-
582
- Kotlin
557
+ Since [experiments](https://posthog.com/docs/experiments/start-here.md) use feature flags, the code for running an experiment is very similar to the feature flags code:
583
558
 
584
559
  ```kotlin
585
560
  import com.posthog.PostHog
@@ -589,18 +564,16 @@ if (PostHog.getFeatureFlag("experiment-feature-flag-key") == "variant-name") {
589
564
  }
590
565
  ```
591
566
 
592
- It's also possible to [run experiments without using feature flags](/docs/experiments/running-experiments-without-feature-flags.md).
567
+ It's also possible to [run experiments without using feature flags](https://posthog.com/docs/experiments/running-experiments-without-feature-flags.md).
593
568
 
594
569
  ## Group analytics
595
570
 
596
- Group analytics allows you to associate the events for that person's session with a group (e.g. teams, organizations, etc.). Read the [Group Analytics](/docs/user-guides/group-analytics.md) guide for more information.
571
+ Group analytics allows you to associate the events for that person's session with a group (e.g. teams, organizations, etc.). Read the [Group Analytics](https://posthog.com/docs/user-guides/group-analytics.md) guide for more information.
597
572
 
598
- > **Note:** This is a paid feature and is not available on the open-source or free cloud plan. Learn more on the [pricing page](/pricing.md).
573
+ > **Note:** This is a paid feature and is not available on the open-source or free cloud plan. Learn more on the [pricing page](https://posthog.com/pricing.md).
599
574
 
600
575
  - Associate the events for this session with a group
601
576
 
602
- Kotlin
603
-
604
577
  ```kotlin
605
578
  import com.posthog.PostHog
606
579
 
@@ -613,8 +586,6 @@ PostHog.group(
613
586
 
614
587
  - Associate the events for this session with a group AND update the properties of that group
615
588
 
616
- Kotlin
617
-
618
589
  ```kotlin
619
590
  import com.posthog.PostHog
620
591
 
@@ -629,21 +600,21 @@ The `name` is a special property which is used in the PostHog UI for the name of
629
600
 
630
601
  ## Error tracking
631
602
 
632
- To set up error tracking in your project, see the [error tracking docs](/docs/error-tracking.md).
603
+ To set up error tracking in your project, see the [error tracking docs](https://posthog.com/docs/error-tracking.md).
633
604
 
634
605
  ## Logs
635
606
 
636
- To set up [logs](/docs/logs.md) in your Android app, follow the [Android logs installation guide](/docs/logs/installation/android.md). The SDK exposes `PostHog.logger.{trace,debug,info,warn,error,fatal}` for sending structured records to PostHog Logs, with batching, offline persistence, and a rate cap built in.
607
+ To set up [logs](https://posthog.com/docs/logs.md) in your Android app, follow the [Android logs installation guide](https://posthog.com/docs/logs/installation/android.md). The SDK exposes `PostHog.logger.{trace,debug,info,warn,error,fatal}` for sending structured records to PostHog Logs, with batching, offline persistence, and a rate cap built in.
637
608
 
638
609
  > **Minimum version:** `com.posthog:posthog-android@3.46.0` or later.
639
610
 
640
611
  ## Session replay
641
612
 
642
- To set up [session replay](/docs/session-replay/mobile.md) in your project, all you need to do is install the Android SDK, enable "Record user sessions" in [your project settings](https://us.posthog.com/settings/project-replay) and enable the `sessionReplay` option.
613
+ To set up [session replay](https://posthog.com/docs/session-replay/mobile.md) in your project, all you need to do is install the Android SDK, enable "Record user sessions" in [your project settings](https://us.posthog.com/settings/project-replay) and enable the `sessionReplay` option.
643
614
 
644
615
  ## Surveys
645
616
 
646
- To set up surveys, follow the [additional installation instructions for Android](/docs/surveys/installation/android.md). Surveys launched with [popover presentation](/docs/surveys/creating-surveys.md#presentation) are automatically shown to users matching the [display conditions](/docs/surveys/creating-surveys.md#display-conditions) you set up.
617
+ To set up surveys, follow the [additional installation instructions for Android](https://posthog.com/docs/surveys/installation/android.md). Surveys launched with [popover presentation](https://posthog.com/docs/surveys/creating-surveys.md#presentation) are automatically shown to users matching the [display conditions](https://posthog.com/docs/surveys/creating-surveys.md#display-conditions) you set up.
647
618
 
648
619
  ## Offline behavior
649
620
 
@@ -660,8 +631,6 @@ If you're not seeing the expected events being captured, the feature flags being
660
631
 
661
632
  You can enable debug mode by setting the `debug` option to `true` in the `PostHogAndroidConfig` object. This will enable verbose logs about the inner workings of the SDK.
662
633
 
663
- Kotlin
664
-
665
634
  ```kotlin
666
635
  val config = PostHogAndroidConfig(apiKey = POSTHOG_API_KEY, host = POSTHOG_HOST).apply {
667
636
  debug = true
@@ -673,8 +642,6 @@ val config = PostHogAndroidConfig(apiKey = POSTHOG_API_KEY, host = POSTHOG_HOST)
673
642
 
674
643
  When creating the PostHog client, pass a `PostHogAndroidConfig`. It inherits the core `PostHogConfig` options and adds Android-specific options.
675
644
 
676
- Kotlin
677
-
678
645
  ```kotlin
679
646
  import com.posthog.PersonProfiles
680
647
  import com.posthog.android.PostHogAndroidConfig
@@ -727,7 +694,7 @@ val config = PostHogAndroidConfig(
727
694
  | `flushAt` | `20` | Number of queued events that triggers a flush. |
728
695
  | `maxQueueSize` | `1000` | Maximum number of events kept across memory and disk before FIFO eviction. |
729
696
  | `maxBatchSize` | `50` | Maximum number of events sent in one batch request. |
730
- | `maxRetries` | `3` | Maximum retry attempts for failed requests. |
697
+ | `maxRetries` | `3` | Maximum retry attempts for push-subscription registration failures. It does not apply to event, session recording, or log ingestion. |
731
698
  | `flushIntervalSeconds` | `30` | Maximum delay before queued data is flushed. |
732
699
  | `encryption` | `null` | Optional `PostHogEncryption` implementation for encrypting persisted queued events. |
733
700
  | `proxy` | `null` | Optional `java.net.Proxy` for PostHog API requests. |
@@ -754,18 +721,16 @@ val config = PostHogAndroidConfig(
754
721
  | --- | --- | --- |
755
722
  | `sessionReplay` | `false` | Enables session replay when project settings also allow recording. |
756
723
  | `sessionReplayConfig` | `PostHogSessionReplayConfig()` | Configures masking, screenshots, Logcat capture, sampling, and custom drawable conversion. |
757
- | `logs` | `PostHogLogsConfig()` | Configures [Android logs](/docs/logs/installation/android.md). |
724
+ | `logs` | `PostHogLogsConfig()` | Configures [Android logs](https://posthog.com/docs/logs/installation/android.md). |
758
725
  | `errorTrackingConfig` | `PostHogErrorTrackingConfig()` | Configures error tracking. `autoCapture` defaults to `false`; set it to `true` to autocapture uncaught exceptions when project settings also enable error tracking. |
759
726
  | `surveys` | `false` | Internal/experimental native Android survey support. Native Android survey UI is not fully supported or documented yet. |
760
727
  | `surveysConfig` | `PostHogSurveysConfig()` | Internal/experimental survey display delegate configuration, primarily for hybrid SDKs. |
761
- | `bootstrap` | `null` | Seeds identity (`distinctId`, `isIdentifiedId`) and feature-flag state (`featureFlags`, `featureFlagPayloads`) before the first `/flags` response. Bootstrapped identity applies to the first session; only enabled flags are served, until the first `/flags` response replaces them. See [SDK bootstrapping](/docs/libraries/bootstrapping.md#behavior-on-mobile-sdks). |
728
+ | `bootstrap` | `null` | Seeds identity (`distinctId`, `isIdentifiedId`) and feature-flag state (`featureFlags`, `featureFlagPayloads`) before the first `/flags` response. Bootstrapped identity applies to the first session; only enabled flags are served, until the first `/flags` response replaces them. See [SDK bootstrapping](https://posthog.com/docs/libraries/bootstrapping.md#behavior-on-mobile-sdks). |
762
729
 
763
730
  ### Event filtering with `beforeSend`
764
731
 
765
732
  Use `addBeforeSend` to redact, modify, or drop events before they are queued. Return `null` to drop an event.
766
733
 
767
- Kotlin
768
-
769
734
  ```kotlin
770
735
  config.addBeforeSend { event ->
771
736
  event.properties?.remove("password")
@@ -784,8 +749,6 @@ You can stop specific screens from being autocaptured by filtering them in your
784
749
 
785
750
  Because it's just a function, you can filter however you like – an **ignorelist** (drop the screens you name), an **allowlist** (invert the check to capture only the screens you name), or any custom rule such as a name prefix, a regex, or a check against the event's properties.
786
751
 
787
- Kotlin
788
-
789
752
  ```kotlin
790
753
  val ignoredScreens = setOf("Splash", "Debug")
791
754
 
@@ -801,7 +764,7 @@ config.addBeforeSend { event ->
801
764
 
802
765
  ## Push notifications
803
766
 
804
- The Android SDK can register a device for [Workflows](/docs/workflows.md) push notifications and capture when a user opens one. For setup, including automatic and manual registration, capturing opens, opting out, and identity verification, see [Push notifications](/docs/workflows/push-notifications.md).
767
+ The Android SDK can register a device for [Workflows](https://posthog.com/docs/workflows.md) push notifications and capture when a user opens one. For setup, including automatic and manual registration, capturing opens, opting out, and identity verification, see [Push notifications](https://posthog.com/docs/workflows/push-notifications.md).
805
768
 
806
769
  ## FAQ
807
770
 
@@ -812,11 +775,3 @@ The Android SDK supports Android API 23 and newer.
812
775
  ## Do I need to declare permissions in the AndroidManifest.xml?
813
776
 
814
777
  Usually, no. The SDK declares `android.permission.INTERNET` and `android.permission.ACCESS_NETWORK_STATE`, and Android's manifest merger adds them to your app. The SDK does not declare or require an Android `Service`.
815
-
816
- ### Still have questions?
817
-
818
- Ask PostHog AI
819
-
820
- ### Was this page useful?
821
-
822
- HelpfulCould be better