# Referral and invite links that survive install

> Referral links with Strait: one invite link per user, the code delivered on the first open after install (exact on Android), with a reward webhook and a per-referrer table.

Source: https://straitlink.in/solutions/referrals/
Markdown: https://straitlink.in/solutions/referrals.md

## Invite links that still know who sent them after the install.

Give every user their own link. When a friend installs and opens your app, the invite code arrives with the first open.

[Start free](https://app.straitlink.in/?signup=1) [How deferred links work](https://straitlink.in/docs/deferred-deep-linking/)

## Where these links break, and what Strait does

1The install

### The invite code is lost in the store.

What it costs you

Your new user signs up without it, the friend who invited them gets nothing, and the programme loses trust.

What Strait does

Keeps the link through the install on Android, so the first launch has the code (iPhone opt-in).

2Who invited whom

### You can’t tell which invites work.

What it costs you

Rewards go out on guesses, and your strongest inviters look like everyone else.

What Strait does

Every tap is recorded with its link, channel and the app open it turned into.

3Abuse

### One link gets passed around a coupon group.

What it costs you

Rewards drain to people who were never invited.

What Strait does

Switch that one link off on its own, or give it an expiry. Grant rewards on your server, once per person.

## One link, wherever you send it

Every place below runs through the same Strait link, and every tap lands on the screen it points to. Channels are counted on their own, even without UTM tags where the app can be recognised.

**WhatsApp**

Friend-to-friend invites

hilltop.strait.link/invite-a7k2

**SMS**

Invites from contacts

hilltop.strait.link/invite-r2d9

**Instagram**

Creator codes in bios

hilltop.strait.link/c/trailrun

**Email**

Refer-a-friend mail

hilltop.strait.link/invite-m4k1

**Print**

Invite cards in the box

hilltop.strait.link/invite-card

Works today

## Build a referral flow with what ships now

### Create one link per user

Your server creates a link with the invite code in its destination, through the REST API or the Node SDK. Use the batch endpoint for an existing user base.

### They share it anywhere

WhatsApp, Instagram, SMS or a QR code. The link lives on your own subdomain, `hilltop.strait.link`.

### The friend installs

On Android the link travels through the Google Play install, so the code is exact. On iPhone, install matching is opt-in and proven on iPhone simulators so far.

### Your app applies the code

The `onLink` callback fires on the first open with the path and the code, and you credit both people your way.

```
curl  https://strait.link/v1/links  \   -H  "Authorization: Bearer $SECRET_KEY"  \   -H  "Content-Type: application/json"  \   -d  '{ "slug": "invite-a7k2", "longUrl": "https://shop.example.com/invite?code=FRIEND10" }'
```

```
links .onLink ((e)  =>  {   if  ( e .matched  &&  e .path  ===  '/invite' ) {     applyInviteCode ( e . params .code);  // "FRIEND10", also on the first open after install   } });
```

Referrals

## Referrals as a feature, not a project

On for every workspace. [Read the referrals docs](https://straitlink.in/docs/referrals/).

### A referral code on every tap

One code per link from the API, or `?strait_ref=CODE` on any link. The code comes back with the first open after install.

### A reward webhook

One `referral.converted` event when an invited friend installs and opens the app, carrying the tap it came from, so your server can grant the reward.

### Refer-and-earn reporting

A Referrals table in the dashboard: taps, installs, revenue and app opens for each referrer, counted from taps in the period.

### Still planned

Creating and managing per-user invite links in the dashboard, without writing the link code yourself.

Counting it

## See which invites turned into users

Every tap on an invite link is recorded with its channel and where we sent it. The app open that follows is joined to that tap and marked as a new or existing user, so you can tell a fresh install from a friend who already had the app. Link-preview bots that unfurl the link in a chat are never counted as taps and never billed.

In the dashboard

## Referral links sit next to the rest

Go further

## Docs for invite links

- [Deferred deep linking How the code survives the install](https://straitlink.in/docs/deferred-deep-linking/)
- [REST API Create links one at a time or in batches](https://straitlink.in/docs/api/)
- [Will it open my app? Check what an invite tap does in each app](https://straitlink.in/tools/will-it-open/)
- [Check your App Links setup Free check of assetlinks.json and apple-app-site-association](https://straitlink.in/tools/assetlinks-checker/)
- [Webhooks Real-time events for every tap](https://straitlink.in/docs/webhooks/)

## Set it up once

Production setup is about a day of developer work plus one app release. After that, links come from the dashboard or your own systems.

- [1Add the SDK React Native, Flutter, iOS, Android, Unity or web, from GitHub.](https://straitlink.in/docs/sdks/)
- [2Verify your links App Links and Universal Links on your workspace domain.](https://straitlink.in/docs/app-links/)
- [3Make links In the dashboard, or from your server with the API.](https://straitlink.in/docs/short-links/)

**With AI** · one prompt

Paste one prompt into your AI coding assistant and it adds the SDK, the link handling and the checks, then you test on a real phone.

```
strait. onLink  { event  in  router. open ( event.path )  }
```

[Get the prompt for your platform](https://straitlink.in/ai/)

## Start with one invite link.

Free for 25,000 taps a month. Start with one invite link and add a code per person.

[Start free](https://app.straitlink.in/?signup=1) [Read the quick start](https://straitlink.in/docs/quick-start/)
