From 378dd212f6b4196210c7b116e86faae63aa68e81 Mon Sep 17 00:00:00 2001 From: Bogdan Ivanov Date: Sun, 22 Feb 2026 06:52:53 +0200 Subject: [PATCH 1/2] feat: US-011 - Add llms.txt to aptabase-react-native Co-Authored-By: Claude Opus 4.6 --- llms.txt | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 llms.txt diff --git a/llms.txt b/llms.txt new file mode 100644 index 0000000..dc20d65 --- /dev/null +++ b/llms.txt @@ -0,0 +1,112 @@ +# Aptabase React Native SDK + +> Privacy-first analytics SDK for React Native and Expo apps. Package: @aptabase/react-native. Open source, GDPR-compliant. Supports iOS and Android. + +## Installation + +```bash +npm add @aptabase/react-native +``` + +Android requires the INTERNET permission in `AndroidManifest.xml`: + +```xml + +``` + +## Initialization + +Call `init` before rendering your app component: + +```js +import Aptabase from "@aptabase/react-native"; + +Aptabase.init(""); + +export default function App() { + return ; +} +``` + +Alternatively, use the React Context provider: + +```jsx +import { AptabaseProvider } from "@aptabase/react-native"; + +export default function App() { + return ( + + + + ); +} +``` + +## Track Events + +```js +import { trackEvent } from "@aptabase/react-native"; + +trackEvent("app_started"); +``` + +## Track Events with Properties + +Properties accept string, number, and boolean values: + +```js +import { trackEvent } from "@aptabase/react-native"; + +trackEvent("purchase_completed", { + product: "subscription", + price: 9.99, + trial: false, +}); +``` + +When using the Context provider, use the `useAptabase` hook: + +```jsx +import { useAptabase } from "@aptabase/react-native"; + +function MyComponent() { + const { trackEvent } = useAptabase(); + trackEvent("screen_viewed", { screen: "home" }); +} +``` + +## Configuration + +The `init` function accepts an optional `AptabaseOptions` object: + +```js +Aptabase.init("", { + host: "https://your-self-hosted-instance.com", // for self-hosted deployments (A-SH-* keys) + appVersion: "1.2.3", // override detected app version (useful in Expo Go) + flushInterval: 30000, // override flush interval in ms (default: 60s prod, 2s dev) +}); +``` + +## Dispose + +To stop tracking and deinitialize the SDK: + +```js +import Aptabase from "@aptabase/react-native"; + +Aptabase.dispose(); +``` + +## Platform Notes + +- Supports iOS and Android via React Native and Expo +- Events are batched and flushed every 60 seconds in production, every 2 seconds in development +- Sessions auto-rotate after 1 hour of inactivity +- Events are flushed when the app goes to background and polling resumes when active +- In Expo Go, `App Version` is unavailable (native modules not loaded) — use the `appVersion` init option as a workaround +- The SDK does not track any events automatically — you control what is sent +- `trackEvent` runs asynchronously in the background — no need to await it + +## Cross-Discovery + +For all Aptabase SDKs and documentation, see: https://aptabase.com/llms.txt From a54dca24b9c92dc573ba0521c141c2971c00f2c6 Mon Sep 17 00:00:00 2001 From: Bogdan Ivanov Date: Sun, 22 Feb 2026 07:09:16 +0200 Subject: [PATCH 2/2] feat: US-018 - Add llms.txt reference to README Co-Authored-By: Claude Opus 4.6 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7feaea6..fe58e95 100644 --- a/README.md +++ b/README.md @@ -84,3 +84,5 @@ A few important notes: ## Preparing for Submission to Apple App Store When submitting your app to the Apple App Store, you'll need to fill out the `App Privacy` form. You can find all the answers on our [How to fill out the Apple App Privacy when using Aptabase](https://aptabase.com/docs/apple-app-privacy) guide. + +For AI/LLM integration instructions, see [llms.txt](./llms.txt)