npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

linkio-backend

v1.3.1

Published

Self-hosted deep linking backend for mobile apps - Open source alternative to Branch.io

Downloads

393

Readme

LinkIO Backend

npm version License: MIT

Self-hosted deep linking backend for mobile apps. Open-source alternative to Branch.io.

🚀 Quick Start

npm install linkio-backend
import express from "express";
import { LinkIO, InMemoryStorage } from "linkio-backend";

const app = express();

const linkIO = new LinkIO({
  domain: "yourdomain.com",
  iosAppId: "123456789",
  iosTeamId: "TEAMID123",
  iosBundleId: "com.yourapp.ios",
  iosAppScheme: "myapp", // For smart redirect (myapp://)
  androidPackageName: "com.yourapp.android",
  androidAppScheme: "myapp", // For smart redirect (myapp://)
  androidSHA256Fingerprints: ["YOUR_SHA256_FINGERPRINT"],
  fallbackTimeout: 2500, // Wait before redirecting to store
  storage: new InMemoryStorage(),
});

// Domain verification endpoints
app.get("/.well-known/*", linkIO.setupWellKnown());

// Generic deep link handler
app.get("/link", linkIO.handleDeepLink());

// API endpoints - Deferred deep linking
app.get("/pending-link/:deviceId", async (req, res) => {
  const data = await linkIO.getPendingLink(req.params.deviceId);
  res.json(data);
});

// Fingerprint-based pending link (for deferred deep linking)
app.get("/pending-link", async (req, res) => {
  const ip = req.ip || req.socket.remoteAddress || "";
  const userAgent = req.headers["user-agent"] || "";
  const data = await linkIO.getPendingLinkByFingerprint(ip, userAgent);
  res.json(data);
});

app.listen(3000);

📦 Features

  • Universal Links (iOS) - Automatic apple-app-site-association generation
  • App Links (Android) - Automatic assetlinks.json generation
  • Smart Redirects - Tries to open app first, falls back to App Store/Play Store
  • Deferred Deep Linking - Fingerprint-based matching preserves link data through install
  • Referral Tracking - Track who referred whom
  • Storage Options - In-memory, Redis, or custom storage
  • TypeScript - Full type definitions included
  • Tested - 31 unit tests with full coverage

📚 Documentation

Configuration

interface LinkIOConfig {
  domain: string; // Your domain (e.g., 'yourdomain.com')
  iosAppId: string; // Apple App Store ID
  iosTeamId: string; // Apple Developer Team ID
  iosBundleId: string; // iOS bundle identifier
  iosAppScheme?: string; // Custom URL scheme (e.g., 'myapp' for myapp://)
  androidPackageName: string; // Android package name
  androidAppScheme?: string; // Custom URL scheme (e.g., 'myapp' for myapp://)
  androidSHA256Fingerprints: string[]; // Android SHA256 cert fingerprints
  fallbackTimeout?: number; // Ms to wait before store redirect (default: 2500)
  storage: LinkIOStorage; // Storage implementation
}

API Endpoints

// Well-known endpoints (auto-generated)
app.get("/.well-known/*", linkIO.setupWellKnown());

// Generic deep link handler - works with ANY params
app.get("/link", linkIO.handleDeepLink());

// Example URLs:
//   https://rokart.in/link?referralCode=ABC123
//   https://speekfeed.in/link?userId=456
//   https://ejaro.com/link?carId=789

// Optional: Path-based routes for cleaner URLs
// app.get("/refer/:referralCode", linkIO.handleDeepLink());
// app.get("/profile/:userId", linkIO.handleDeepLink());

// ===========================================
// API ENDPOINTS - Match your SDK's backendURL
// ===========================================

// Get pending link for deferred deep linking
app.get("/pending-link/:deviceId", async (req, res) => {
  const data = await linkIO.getPendingLink(req.params.deviceId);
  res.json(data);
});

// Track referral
app.post("/track-referral", async (req, res) => {
  const { referralCode, userId, metadata } = req.body;
  await linkIO.trackReferral(referralCode, userId, metadata);
  res.json({ success: true });
});

// Get referrals for a user
app.get("/referrals/:referrerId", async (req, res) => {
  const referrals = await linkIO.getReferrals(req.params.referrerId);
  res.json({ referrals });
});

Storage Options

In-Memory (Development)

import { InMemoryStorage } from "linkio-backend";
const storage = new InMemoryStorage();

Redis (Production)

import { RedisStorage } from "linkio-backend";
import { createClient } from "redis";

const redis = await createClient().connect();
const storage = new RedisStorage(redis);

Custom Storage

import { LinkIOStorage } from "linkio-backend";

class CustomStorage implements LinkIOStorage {
  // Implement interface methods
}

🔗 Related Packages

🛠️ Development

# Install dependencies
npm install

# Build
npm run build

# Run example server
npm run dev

# Run tests
npm test

📄 License

MIT

🤝 Contributing

Contributions are welcome! Please read the contributing guidelines first.

📞 Support

⭐ Show Your Support

Give a ⭐️ if this project helped you!