linkapp.config.ts
Define match rules
hostnames(required) — domains your app supports. List every variant you expect (youtube.com,www.youtube.com,m.youtube.com, etc.).patterns— optional pathname/search combos that must match. Leave empty to match any path on the hostnames.notPatterns— optional exclusions, useful when matching a broad path with specific carve-outs.
Pattern syntax cheatsheet
Patterns use URLPattern semantics.
Paths are case-sensitive. Query parameters can appear in any order.
Test your rules
Use the CLI to confirm matches before shipping:package.json
Troubleshoot fast
- Double-check hostnames—include
www/mobile/regional variants explicitly. - Ensure named parameters keep the colon (
/user/:id, not/user/id). - Declare query parameters with both the key and placeholder (
search: "v=:videoId"). - Replace overly broad wildcards if you see unexpected matches.
Best practices
- Start specific, then add broader fallbacks (
/watchbefore/:id). - Document uncommon paths with inline comments for future maintainers.
- Keep the total number of patterns below the 50-pattern limit.
- Re-run
linkapp test-url-match-rulesafter every config change.