Complete guide to integrating Redirectly into your applications. From setup to production deployment.
Set up your account and create your first link
First, you'll need to get your API key from the Redirectly dashboard.
Sign in to your dashboard and your API key will be displayed automatically.
Open DashboardDashboard Screenshot
API Key location will be shown here
Choose a unique username that will become your personal subdomain. Your links will be:
https://your-username.redirectly.app/your-link
Choose carefully - usernames cannot be changed after creation!
Username Selection Screenshot
Username creation dialog will be shown here
Integrate with popular backend frameworks
npm install axios # or yarn add axios
const axios = require('axios'); const redirectly = axios.create({ baseURL: 'https://redirectly.app/api', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } });
// Create a permanent link const createLink = async () => { try { const response = await redirectly.post('/links', { slug: 'my-awesome-link', target: 'https://example.com' }); console.log('Link created:', response.data.url); return response.data; } catch (error) { console.error('Error:', error.response?.data); } }; // Create a temporary link const createTempLink = async () => { try { const response = await redirectly.post('/v1/temp-links', { target: 'https://example.com/temp-content', ttlSeconds: 3600 // 1 hour }); console.log('Temp link:', response.data.url); return response.data; } catch (error) { console.error('Error:', error.response?.data); } };
Configure iOS, Android, and Flutter apps for deep linking
dependencies: flutter_redirectly: ^2.0.0
import 'package:flutter_redirectly/flutter_redirectly.dart'; class RedirectlyService { static final FlutterRedirectly _redirectly = FlutterRedirectly(); static Future<void> initialize() async { await _redirectly.initialize(RedirectlyConfig( apiKey: 'YOUR_API_KEY', baseUrl: 'https://redirectly.app', enableDebugLogging: true, )); } static FlutterRedirectly get instance => _redirectly; }
// Listen for incoming links class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State<MyApp> { @override void initState() { super.initState(); _setupLinkHandling(); } void _setupLinkHandling() { // Listen to link clicks when app is running RedirectlyService.instance.onLinkClick.listen((clickEvent) { if (clickEvent.error == null) { // Navigate based on username and slug Navigator.of(context).pushNamed( '/${clickEvent.username}/${clickEvent.slug}' ); } else { // Handle error ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text('Error: ${clickEvent.error}')), ); } }); // Check for initial link (cold start) _checkInitialLink(); } void _checkInitialLink() async { final initialLinkEvent = await RedirectlyService.instance.getInitialLink(); if (initialLinkEvent != null) { // Handle initial link same way as above Navigator.of(context).pushNamed( '/${initialLinkEvent.username}/${initialLinkEvent.slug}' ); } } }
Add the following to your android/app/src/main/AndroidManifest.xml
:
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme"> <!-- Existing intent filters --> <!-- Add this for Redirectly links --> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="YOUR_USERNAME.redirectly.app" /> </intent-filter> </activity>
Add the following to your ios/Runner/Info.plist
:
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>redirectly.app</string> <key>CFBundleURLSchemes</key> <array> <string>https</string> </array> </dict> </array>
The flutter_redirectly package uses pure Dart code with no native dependencies, making it faster to build and easier to debug!
Use your dashboard or API to create a test link like test-mobile
Send yourself the link via SMS/email and tap it. Your app should open and handle the link.
Force-close your app, then tap the link again to test cold start handling.
Tips for production deployment and optimization
You now have everything you need to integrate Redirectly into your applications. Create powerful, trackable short links with deep linking support across all platforms.