@ihavealink.app/expo
v0.6.3
Published
IHaveALink expo module
Readme
IHaveALink Expo SDK
A lightweight deep linking and deferred deep linking SDK for Expo apps.
Installation
npm install @ihavealink/expoQuick start
import IHaveALink, {
checkForDeferredLink,
createLink,
initialize,
resolveLink,
} from "@ihavealink/expo";
await initialize({ publishableKey: "pk_..." });
const deferred = await checkForDeferredLink();
if (deferred) {
// Route user based on deferred link data
}
const createResult = await createLink({
title: "My Link",
description: "Created from app",
tags: ["mobile"],
});
if (createResult.success) {
// createResult.link contains the created link
} else {
// createResult.error contains error details
}
const resolveResult = await resolveLink("https://myapp.ihavea.link/abc123");
if (resolveResult.success) {
// resolveResult.link contains the resolved link data
} else {
// resolveResult.error contains error details
}Design choices in v1
- Domain validation is dynamic: the SDK fetches your verified custom domains from the server and validates incoming URLs against that allowlist. Default base domain is
ihavea.link. - Link creation is server-side: to keep publishable keys safe and align with best practices, client apps should call your backend to create links.
- Consistent device fingerprinting: the SDK sends CSS pixels, DPR (2 decimals), timezone, language and color depth. The server performs fuzzy matching with adaptive thresholds.
- Error handling: all functions use discriminated unions for consistent error handling patterns.
Headers sent by SDK
X-Publishable-Key: your publishable keyX-App-Bundle-Id: host app bundle identifierX-SDK-Platform:iOSorAndroidX-SDK-Version: SDK version string
Notes
- Rate limiting and bot protections should be configured on the server.
- Apple Search Ads integration and additional matching signals can be added in future versions.
