@lastshotlabs/slingshot-deep-links
v0.0.2
Published
Universal links, Android app links, and fallback redirects for slingshot
Readme
title: Human Guide description: Human-maintained guidance for @lastshotlabs/slingshot-deep-links
@lastshotlabs/slingshot-deep-links publishes the well-known files and browser fallback routes needed
for iOS universal links and Android app links. It is a small infrastructure plugin: no entities, no
auth coupling, and no hidden state beyond the compiled route config it publishes in plugin state.
When To Use It
Use this package when your app needs:
/.well-known/apple-app-site-associationfor iOS universal-link ownership/.well-known/assetlinks.jsonfor Android app-link ownership- browser fallback redirects such as
/share/*to a canonical web route
Do not use it as a general redirect framework. Its job is limited to native deep-link ownership and fallback handling.
Minimum Setup
At least one of these config sections is required:
appleandroidfallbackRedirects
If you configure fallbackRedirects, you must also configure fallbackBaseUrl. The base URL must
use https:// and must not have a trailing slash.
The plugin has no declared dependencies, so it can be registered anywhere in the plugin list.
What You Get
The plugin wires three surfaces:
GET /.well-known/apple-app-site-associationwhen Apple config is presentGET /.well-known/assetlinks.jsonwhen Android config is present- configured browser fallback
GETroutes for wildcard sources such as/share/*
It also:
- precompiles the AASA and assetlinks payloads once at plugin construction time
- marks the two well-known routes as public paths so auth middleware skips them automatically
- warns during
setupPostif another plugin already owns a colliding path
Common Customization
The main config decisions are:
apple: one app or an array of app targets, each withteamId,bundleId, and allowedpathsandroid: one package target withpackageNameand certificate fingerprintsfallbackRedirects: wildcard source-to-target mappingsfallbackBaseUrl: canonical HTTPS web origin used when native handling is unavailable
If you need to change behavior, start in:
src/config.tsfor validation and normalization rulessrc/routes.tsfor well-known route registration and fallback redirectssrc/fallback.tsfor wildcard expansion logic
Gotchas
- The config fails validation unless at least one of
apple,android, orfallbackRedirectsis provided. - Fallback source patterns must end in
*, and target patterns cannot contain*. - The fallback routes issue
302redirects. They are for browser fallback behavior, not permanent SEO canonicalization. - Path collisions are warnings, not silent overrides. If another plugin owns the same route, fix the app-level route plan rather than relying on registration order.
Key Files
src/index.tssrc/config.tssrc/plugin.tssrc/routes.tssrc/fallback.tssrc/aasa.tssrc/assetlinks.ts
