@linkforty/core 1.25.4 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/database.d.ts.map +1 -1
- package/dist/lib/database.js +19 -0
- package/dist/lib/database.js.map +1 -1
- package/dist/lib/launchpad.d.ts +178 -0
- package/dist/lib/launchpad.d.ts.map +1 -0
- package/dist/lib/launchpad.js +262 -0
- package/dist/lib/launchpad.js.map +1 -0
- package/dist/lib/launchpad.test.d.ts +2 -0
- package/dist/lib/launchpad.test.d.ts.map +1 -0
- package/dist/lib/launchpad.test.js +220 -0
- package/dist/lib/launchpad.test.js.map +1 -0
- package/dist/routes/links.d.ts.map +1 -1
- package/dist/routes/links.js +10 -4
- package/dist/routes/links.js.map +1 -1
- package/dist/routes/redirect.d.ts +19 -0
- package/dist/routes/redirect.d.ts.map +1 -1
- package/dist/routes/redirect.js +165 -47
- package/dist/routes/redirect.js.map +1 -1
- package/dist/routes/redirect.launchpad.test.d.ts +2 -0
- package/dist/routes/redirect.launchpad.test.d.ts.map +1 -0
- package/dist/routes/redirect.launchpad.test.js +398 -0
- package/dist/routes/redirect.launchpad.test.js.map +1 -0
- package/dist/routes/redirect.no-web-destination.test.js +32 -11
- package/dist/routes/redirect.no-web-destination.test.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/llms.txt +16 -0
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -102,6 +102,18 @@ interface ServerOptions {
|
|
|
102
102
|
origin: string | string[];
|
|
103
103
|
};
|
|
104
104
|
logger?: boolean; // Enable Fastify logger
|
|
105
|
+
trustProxy?: boolean | number; // Trust X-Forwarded-For behind a proxy
|
|
106
|
+
redirect?: {
|
|
107
|
+
abuseReportUrl?: string; // Linked from the link-safety warning page
|
|
108
|
+
launchpad?: {
|
|
109
|
+
// Richer content for the launchpad page (see Redirect Flow). Return null
|
|
110
|
+
// for the default. `heroHtml` is inserted unescaped — render it yourself.
|
|
111
|
+
resolveContent?: (link, settings) => Promise<LaunchpadContent | null>;
|
|
112
|
+
// Receives `{ linkId, event }` beacons ("view", "cta_ios", "cta_android",
|
|
113
|
+
// "cta_open") from the page. Unset = the page sends nothing.
|
|
114
|
+
beaconUrl?: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
105
117
|
}
|
|
106
118
|
```
|
|
107
119
|
|
|
@@ -178,6 +190,7 @@ interface Link {
|
|
|
178
190
|
og_description?: string;
|
|
179
191
|
og_image_url?: string;
|
|
180
192
|
og_type?: string;
|
|
193
|
+
launchpad_mode?: 'inherit' | 'on' | 'off'; // Launchpad page override
|
|
181
194
|
|
|
182
195
|
// Lifecycle
|
|
183
196
|
attribution_window_hours?: number; // Default: 168 (7 days)
|
|
@@ -226,6 +239,7 @@ interface CreateLinkRequest {
|
|
|
226
239
|
ogDescription?: string;
|
|
227
240
|
ogImageUrl?: string;
|
|
228
241
|
ogType?: string;
|
|
242
|
+
launchpadMode?: 'inherit' | 'on' | 'off';
|
|
229
243
|
attributionWindowHours?: number; // 1-2160
|
|
230
244
|
customCode?: string; // Custom short code (auto-generated if omitted)
|
|
231
245
|
expiresAt?: string; // ISO 8601 datetime
|
|
@@ -590,6 +604,8 @@ When a user clicks a short link (e.g., `https://go.yourdomain.com/abc123`):
|
|
|
590
604
|
6. Append UTM parameters to destination URL
|
|
591
605
|
7. Return 302 redirect
|
|
592
606
|
|
|
607
|
+
**Launchpad page.** A desktop visitor to a link that resolves no web destination (link → template → workspace `appConfig`) gets a hosted landing page instead of an error: title/description/image from the link's `og_*` fields (falling back to `title`/`description`), the app's icon and name, App Store / Google Play buttons, and a QR code to continue on a phone. `noindex`, `Cache-Control: no-store`, nonce-based CSP, no automatic navigation. Controlled by `organizations.settings.launchpad` — `{ desktop: "no-destination" | "always" | "off", mobile: "store" | "page", appName, appIconUrl, accentColor }` — and per link by `links.launchpad_mode` (`launchpadMode` on the API: `inherit` | `on` | `off`; the link wins). Default: served only where the alternative is nothing. With `off`, the plain "This link opens in an app" page is served instead. With `mobile: "page"`, a phone visitor whose platform has no Universal Link / App Link on the link gets the page too — "Open in app" as a tap-only button (fragment appended on tap), their own store button, and the web fallback as a "Continue on the web" link (which keeps the Universal Link second chance inside in-app browsers) — instead of the store redirect or scheme interstitial; Universal Link / App Link links keep their 302. Exported helpers: `renderLaunchpadPage()`, `defaultLaunchpadContent()`, `shouldServeLaunchpadOnDesktop()`, `shouldServeLaunchpadOnMobile()`, `readLaunchpadSettings()`.
|
|
608
|
+
|
|
593
609
|
## Fingerprint Attribution
|
|
594
610
|
|
|
595
611
|
When a mobile SDK reports an install, Core matches it to a previous click using probabilistic fingerprinting:
|