This walkthrough wires the SDK into a small Expo game from scratch. By the end you are tracking sessions, screens, a purchase, and a custom event.
npm install @keewano/react-native-expo-sdkInitialise once in your root component:
import { useEffect } from 'react';
import { Keewano } from '@keewano/react-native-expo-sdk';
export default function App() {
useEffect(() => {
void Keewano.init({ apiKey: 'your-project-api-key' });
}, []);
return <RootNavigator />;
}At this point session context, button taps, and errors are already being captured.
Add the navigation hook so screen changes become SCENE_LOADED / SCENE_UNLOADED:
import { usePathname } from 'expo-router';
import { useKeewanoNavigation } from '@keewano/react-native-expo-sdk';
function RootLayout() {
useKeewanoNavigation(usePathname);
// ...
}In your buy handler, report the purchase once the store confirms it:
async function onBuyGems() {
const result = await store.purchase('gem_pack_large');
if (result.ok) {
Keewano.reportInAppPurchase({
productName: 'gem_pack_large',
price: { priceUsdCents: 499 },
});
Keewano.reportInAppPurchaseItemsGranted({
productName: 'gem_pack_large',
items: [{ name: 'gems', count: 500 }],
});
}
}Report onboarding milestones as the player advances:
Keewano.reportOnboardingMilestone('TutorialComplete');Declare your own events, generate typed helpers, and call them:
npx keewano-codegen --input keewano-custom-eventsimport { customEventSet, reportGameScore } from '../keewano-custom-events/keewano-events.generated';
// pass the schema at init
Keewano.init({ apiKey: '...', customEventSet });
// report it anywhere, fully typed
reportGameScore(13050);See Custom Events for the full workflow.
Mark your own session as a test user and check the events arrive - see Integration Testing.
Keewano.markAsTestUser('dev');Related: Getting Started | Integration Testing | Existing App Integration