Automate the creation of AppsFlyer OneLink deep links and QR codes using Playwright browser automation.
- Bulk OneLink Creation - Generate multiple OneLinks from a configuration file
- QR Code Export - Automatically download QR codes as SVG files
- Session Persistence - Login once, reuse authentication for subsequent runs
- Customizable Parameters - Configure deep link values and promo codes per link
- Generate personalized referral links with unique promo codes
- Create QR codes for marketing campaigns at scale
- Automate repetitive OneLink creation tasks in AppsFlyer dashboard
- Node.js 18+
- An AppsFlyer account with OneLink access
- At least one existing OneLink template to duplicate
git clone https://github.com/stefanminch/appsflyer-onelink-automation.git
cd appsflyer-onelink-automation
npm install
npx playwright install chromiumRun the login command to authenticate and save your session:
npm run loginA browser window will open. Log in to your AppsFlyer account manually, then press Enter in the terminal when you see the OneLink dashboard.
Edit src/link-data.ts to define the links you want to create:
export const linksToCreate: LinkConfig[] = [
{ filename: 'campaign-summer', deepLinkValue: 'SUMMER24', promoCode: 'SUMMER24' },
{ filename: 'campaign-winter', deepLinkValue: 'WINTER24', promoCode: 'WINTER24' },
];| Field | Description |
|---|---|
filename |
Name for the downloaded SVG file |
deepLinkValue |
Value for Deep linking & redirection > Deep link value |
promoCode |
Value for Attribution parameters > promo_code |
Run the automation to create all configured links:
npm startQR code SVGs will be saved to the downloads/ folder.
To create just one link by index:
npm run create-link 0 # Creates the first link in the arrayEdit src/config.ts to customize behavior:
export const config = {
headless: false, // Set to true for background execution
slowMo: 100, // Delay between actions in ms (for debugging)
};- Opens the AppsFlyer OneLink dashboard
- Duplicates the first OneLink in your list
- Updates the deep link value and promo code
- Creates the link and downloads the QR code as SVG
- Repeats for each link in your configuration
"Auth file not found" - Run npm run login first to authenticate.
Links not being created - Ensure you have at least one existing OneLink to duplicate. The script duplicates the first link in your OneLink list.
Session expired - Re-run npm run login to refresh your authentication.
- Playwright - Browser automation
- TypeScript - Type safety
- tsx - TypeScript execution
MIT