# Quick start

> Set up InfluTo end to end — create the app, add the SDK, connect purchase validation, launch a campaign and confirm a test purchase is attributed.

This page takes you from a new account to a test purchase that InfluTo attributes to a creator. Plan for an afternoon: most of the time goes into the store or RevenueCat settings, not into code.

If you use an AI coding agent, it can do most of these steps for you over MCP — see [Connect an AI agent](https://docs.influ.to/agents/index.md).

## Before you start

- An app on the App Store, Google Play, or both. Store search fills in the details; you can also add an unpublished app by hand.
- Either RevenueCat already handling purchases, or access to App Store Connect and the Google Play Console for [store-direct](https://docs.influ.to/integrations/store-direct.md) validation.
- A card for the first wallet deposit (from $50, refundable while unused). You only need it before you activate a campaign.

<!-- steps -->

### Create your account and app

Sign up at [influ.to](https://influ.to/auth/signup?type=developer) as a developer. The dashboard asks you to create an organization first — that's your company, and it owns the wallet.

Then open **My Apps → Add App**, search for your app by name or store URL, and pick the platforms it ships on. The app gets a slug (for example `fitnow`), which becomes the first part of every referral link: `https://influ.to/fitnow/MAYA`.

Open **Setup & SDK** and copy the app's **API key** (it starts with `it_`). One key works for sandbox and production. Keep it out of committed source — read it from your build config or secrets.

### Install the SDK

Add the one SDK that matches your app's stack. Not sure which? See [Choose an SDK](https://docs.influ.to/sdk.md).

<!-- tabs -->

```bash title="React Native / Expo"
npm install @influto/react-native-sdk
# AsyncStorage is a native module — install it in the app too
npm install @react-native-async-storage/async-storage
```

```swift title="iOS (Swift)"
// Xcode → File → Add Package Dependencies →
//   https://github.com/influto/influto-ios   (from 1.1.1)
// Or in Package.swift:
.package(url: "https://github.com/influto/influto-ios.git", from: "1.1.1")
```

```kotlin title="Android (Kotlin)"
// build.gradle.kts
dependencies {
    implementation("to.influ:android-sdk:1.1.1")
    // optional: Compose code field (InfluToReferralCodeInput)
    implementation("to.influ:android-sdk-ui:1.1.1")
    // optional: store-direct purchase auto-capture
    implementation("to.influ:android-sdk-billing:1.1.1")
}
```

```bash title="Flutter (Dart)"
flutter pub add influto
# optional: automatic store-direct purchase capture
flutter pub add influto_iap
```

```bash title="Web / Capacitor / PWA"
npm install @influto/web
# Capacitor / Ionic apps (device info, storage, deep links):
npm install @capacitor/device @capacitor/preferences @capacitor/app
```

<!-- /tabs -->

### Initialize it once at startup

Call `initialize` once when the app launches. It's one of only two calls that throw — if it fails, surface the error instead of swallowing it.

<!-- tabs -->

```tsx title="React Native / Expo"
import InfluTo from '@influto/react-native-sdk';

// Call once at startup (e.g. in App.tsx)
await InfluTo.initialize({
  apiKey: 'YOUR_API_KEY',
  debug: __DEV__,
});
// RevenueCat apps: nothing else to wire — if react-native-purchases is
// installed, the SDK sets the influto_code subscriber attribute itself.
```

```swift title="iOS (Swift)"
import InfluTo

// Call once at launch
var config = InfluToConfig(apiKey: "YOUR_API_KEY", debug: true)
// RevenueCat apps: hand the SDK a setter so it can tag the subscriber
// config.revenueCatAttributeSetter = { attrs in Purchases.shared.attribution.setAttributes(attrs) }
try await InfluTo.initialize(config)
```

```kotlin title="Android (Kotlin)"
import to.influ.sdk.InfluTo
import to.influ.sdk.InfluToConfig

// Call once at startup. initialize() is a suspend function — launch it from a
// coroutine, or use the callback overload: InfluTo.initialize(context, config) { result -> }
lifecycleScope.launch {
  InfluTo.initialize(applicationContext, InfluToConfig(
    apiKey = "YOUR_API_KEY",
    // RevenueCat apps: optional explicit setter (otherwise found by reflection)
    // revenueCatAttributeSetter = { attrs -> Purchases.sharedInstance.setAttributes(attrs) },
  ))
}
```

```dart title="Flutter (Dart)"
import 'package:influto/influto.dart';

// Call once at startup
await InfluTo.instance.initialize(
  InfluToConfig(
    apiKey: 'YOUR_API_KEY',
    // RevenueCat apps: let the SDK tag the subscriber
    // revenueCatHook: (attrs) => Purchases.setAttributes(attrs),
  ),
);
```

```ts title="Web / Capacitor / PWA"
import InfluTo from '@influto/web';
import { capacitorAdapters } from '@influto/web/capacitor'; // Capacitor / Ionic only

// Call once at startup (Capacitor: after platform ready; PWA: on page load)
await InfluTo.initialize({
  apiKey: 'YOUR_API_KEY',
  appVersion: '1.2.3',
  ...(await capacitorAdapters()),   // omit in a plain PWA / browser
  // RevenueCat apps: revenueCat: revenueCatCapacitor(Purchases)  (from '@influto/web/revenuecat')
});
```

<!-- /tabs -->

### Detect referred users

`checkAttribution` tells you whether this install came through a creator's link or code. It never throws; on any problem it answers "not attributed".

<!-- tabs -->

```tsx title="React Native / Expo"
const attribution = await InfluTo.checkAttribution();
if (attribution.attributed) {
  // User came from a referral — show a special offer / extended trial.
  // The SDK also sets the RevenueCat attributes influto_code + influto_referral.
  console.log('Referred by', attribution.referralCode);
}
```

```swift title="iOS (Swift)"
let attribution = await InfluTo.checkAttribution()
if attribution.attributed {
  // User came from a referral — show a special offer.
  print("Referred by \(attribution.referralCode ?? "")")
}
```

```kotlin title="Android (Kotlin)"
val attribution = InfluTo.checkAttribution()   // suspend
if (attribution.attributed) {
  // User came from a referral — show a special offer.
  Log.d("App", "Referred by ${attribution.referralCode}")
}
```

```dart title="Flutter (Dart)"
final attribution = await InfluTo.instance.checkAttribution();
if (attribution.attributed) {
  // User came from a referral — show a special offer.
  print('Referred by ${attribution.referralCode}');
}
```

```ts title="Web / Capacitor / PWA"
const attribution = await InfluTo.checkAttribution();
if (attribution.attributed) {
  // User came from a referral — show a special offer / extended trial.
  // With a RevenueCat binding the SDK also sets influto_code + influto_referral.
  console.log('Referred by', attribution.referralCode);
}

// Web deep links: referral links send web visitors to your app URL with
// ?influto_code=…&influto_click=… — the SDK claims them automatically.
```

<!-- /tabs -->

When the user signs in, call `identifyUser` with the same user ID your purchase system uses (for RevenueCat, the app user ID). It lets InfluTo connect purchases to the referral even when a subscriber attribute is missing.

Optional but recommended: let people type a creator's code, for referrals that come from podcasts, videos and conversations. See [Let users enter a referral code](https://docs.influ.to/guides/referral-codes.md).

### Connect purchase validation

InfluTo only pays commission on purchases it has verified with the store. Choose **exactly one** path per platform — wiring both reports every purchase twice.

<!-- cards -->
- [RevenueCat](https://docs.influ.to/integrations/revenuecat.md) — You already use RevenueCat. Paste a RevenueCat v2 secret key on **Setup & SDK** and InfluTo creates the webhook for you, or add it by hand.
- [Store-direct](https://docs.influ.to/integrations/store-direct.md) — No RevenueCat. Add your App Store Server API key and Google Play service account under **Settings → Validation**; the SDK reports purchases.
<!-- /cards -->

Not sure? [Choose a validation path](https://docs.influ.to/integrations.md) compares them.

### Create a campaign and fund the wallet

Open **Campaigns** and create one: a name and description creators will read, the commission percentage, and whether the program is public (listed on [influ.to/affiliate-programs](https://influ.to/affiliate-programs)), private (anyone with the link) or invite-only. New campaigns start as drafts.

Add funds under **Billing → Add Funds** (from $50), then activate the campaign. Activation needs at least $50 available in the wallet. See [Create a campaign](https://docs.influ.to/platform/create-campaign.md) and [Wallet and payouts](https://docs.influ.to/platform/wallet.md).

### Test a referred purchase

You need a creator account that isn't a member of your organization — members can't join their own campaigns. Use a second email address (or a colleague), join your campaign from its join link, and copy the referral link.

1. On a test device, open your referral link, then install your test build.
2. Launch the app — `checkAttribution` should report `attributed: true` with your code.
3. Make a sandbox purchase (a TestFlight or sandbox tester account on iOS, a license tester on Google Play).
4. Open **Real-Time Events**: you should see the SDK events and the purchase, marked as attributed to your code.

Sandbox purchases are recorded and shown, but they never touch your wallet, stats or payouts.

On the RevenueCat path you can also press **Send Test Webhook** on **Setup & SDK** to check the webhook connection without a device.

<!-- /steps -->

## Check that everything is live

The **Setup & SDK** page shows which SDK version and platform last connected. For a full checklist — eight steps from "app created" to "attributed conversion" — call the integration status endpoint or ask your agent to run `influto_integration_status`. See [Verify the integration](https://docs.influ.to/integrations/testing.md).

## Next steps

<!-- cards -->
- [Invite creators](https://docs.influ.to/platform/invite-influencers.md) — Share your join link, send invitations, and see what creators get.
- [Commissions and fees](https://docs.influ.to/platform/commissions.md) — How commission and the 10% fee are calculated, refunds, and rate changes.
- [Reward referred users](https://docs.influ.to/guides/referral-offers.md) — Give people who came through a creator a better offer.
- [Troubleshooting](https://docs.influ.to/advanced/troubleshooting.md) — The usual reasons a purchase isn't attributed, and how to fix them.
<!-- /cards -->
