Generated Computers
Locals: an Apple Silicon engine that runs local LLMs up to 3x faster. A product of Generated Computers.
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Strait SDK for Capacitor and Ionic: deep links, deferred deep links and link-open analytics (wraps the native Android and iOS SDKs).
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗@straitlink/capacitor gives a Capacitor 8 app (Ionic, Vue, React, Angular or plain JS) direct
links (App Links, Universal Links, custom schemes), deferred links that survive the install, and
link-open analytics. It wraps the Strait Android
and iOS SDKs, and its API matches
@straitlink/react-native.
You need: a Capacitor 8 app with android/ and/or ios/ added, and from
Dashboard → Get started your publishable key (st_pub_live_…) and link domain
(https://<your-handle>.strait.link).
Android builds of a Capacitor 8 app need JDK 21 (Capacitor's own requirement; with JDK 17 the
Gradle build fails). Android Studio's bundled JDK is 21; on the command line check java -version.
1. Install and sync
npm install @straitlink/capacitor
npx cap sync
2. Start it when your app starts (for example in main.ts)
import { createStrait } from '@straitlink/capacitor';
const strait = createStrait({
publishableKey: 'st_pub_live_…', // safe in apps; never the secret key
endpoint: 'https://<your-handle>.strait.link',
});
strait.onLink((e) => {
console.log('Strait link:', e.kind, e.route, e.matched, e.path);
if (e.matched && e.path) router.push({ path: e.path, query: e.params }); // your router
});
strait.start();
3. Let the app claim your link domain
Android, android/app/src/main/AndroidManifest.xml, inside the main <activity>:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="<your-handle>.strait.link" />
</intent-filter>
iOS, Xcode → App target → Signing & Capabilities → + Associated Domains →
applinks:<your-handle>.strait.link.
In Dashboard → Settings → App: your Android package name + signing SHA-256, and your
Apple Team ID + bundle ID. Strait then serves assetlinks.json and the
apple-app-site-association file for you.
You should see: run the app on a phone or emulator, then open one of your links:
adb shell am start -a android.intent.action.VIEW -d "https://<your-handle>.strait.link/<code>"
xcrun simctl openurl booted "https://<your-handle>.strait.link/<code>"
The app opens on the link's screen and the console prints
Strait link: direct app_link true /p/42 (your path). The open shows up in the dashboard's
Analytics within a minute. On a fresh install the first launch prints a deferred event instead.
In a debug build, after start():
const report = await strait.doctor();
for (const f of report.findings) console.log(f.severity, f.id, f.title, f.fix);
You should see ok key.ok, ok app.listed and, on Android, ok cert.listed. Anything marked
error comes with the fix, for example cert.missing: "Add AB:CD:… in Dashboard → Apps & stores.
Debug, release and Play App Signing keys each have their own fingerprint."
| Feature | Status | Notes |
|---|---|---|
| Android: direct links and deferred links | ● Live | Deferred = exact match through the Play Install Referrer (read for you). |
| iPhone links (Universal Links, custom schemes) | ● Live | Through Capacitor's AppDelegate / SceneDelegate proxy: no extra code. |
| iPhone: install matching (deferred links) | Opt-in | Your choice in Dashboard → Settings → iPhone installs, read at runtime. See the iOS SDK. |
| iOS with CocoaPods | – Not yet | Swift Package Manager only (the Capacitor 8 default for new apps). |
| Web | – | Every call resolves a safe default; use @straitlink/web for websites. |
| Published on npm | ● Live | npm install @straitlink/capacitor |
● Live · Opt-in: off until you switch it on · – Not yet. The same words as the platform status page.
| Call | What it does |
|---|---|
createStrait({ publishableKey, endpoint, linkHosts? }) | One client per app. Throws only for a missing or secret key. linkHosts adds custom short-link hosts or old <x>.page.link hosts. |
start() | Reads the link that launched the app, listens for new ones, runs the deferred check once per install, sends saved open reports. Call it once, after onLink. |
onLink(cb) | Every link event, including ones from before you subscribed. Returns an unsubscribe. |
onLinkStart(cb) | A link just arrived and is being resolved: show a loading state. |
checkDeferred() | Asks for the deferred link again (settings or debug screens). Doesn't add an install. |
trackEvent(name, { value, currency, linkId, clickId }) | Conversion or revenue event, placed on the tap of the last attributed open (7 days). Resolves true when accepted. |
pendingOpenReports() / flushOpenReports() | Open reports saved while offline (sent again on start and resume). |
deviceClass() | phone or tablet (iPad / 600 dp and up), as sent with open reports. |
openStoreSheet(url, options?) | The app store inside your app for one of your links (another app to install), deep link kept through the install. Options: androidPackage, listing, inline, appStoreId, providerToken, customProductPageId, style. Resolves { opened, method, clickId, linkId, referrer, reason }. |
doctor() | Setup check for debug builds (key, endpoint, this app listed in your link domain's files, Android signing certificate). Resolves { ok, findings }. |
stop() | Stops delivering events to this object. |
LinkEvent: id, kind (direct|deferred), route (app_link|custom_scheme|install_referrer|fingerprint|clipboard), appState (closed|background|foreground), matched, reason, rawUrl, url, path, params, linkId, referralCode, ms, at.
After createStrait, nothing throws: a failure resolves matched: false with a reason, false, 0 or nothing.
The plugin is a thin layer. All link logic (resolving short links, the once-per-install deferred check, open reports and their retry queue, app-state labels) runs in the native SDKs, which share golden test vectors with the Strait engine:
strait-sdk-android v0.8.3 from JitPack. The plugin adds JitPack to your Gradle
repositories, limited to the com.github.strait-link group, so nothing else is ever fetched from
it. It reads the Play Install Referrer (com.android.installreferrer:installreferrer:2.2), the launch
intent and onNewIntent, and keeps state in SharedPreferences (strait).StraitSDK 0.9.4+ through Swift Package Manager. Links come from Capacitor's
capacitorOpenURL / capacitorOpenUniversalLink notifications; state lives in UserDefaults.What gets recorded, the privacy details and the match methods are the same as the native SDKs: see Android and iOS.
A sideloaded app never gets a Play Install Referrer. Debug builds only accept a stand-in on the first launch after install (release builds ignore it):
adb shell am start -n <your.package>/.MainActivity \
--es strait.debugReferrer "'strait_link=lnk_…&strait_click=…'"
Take both values from the Play Store URL your link redirects an Android phone to (its referrer=).
Measured 25 Oct 2026 on 0.3.0.
| What | Size or time | How it was measured |
|---|---|---|
| npm package | 15.6 KB download, 50 KB unpacked (JS, plus the Android and iOS plugin sources) | npm pack --dry-run |
| In your web bundle | 1.5 KB minified, 0.8 KB gzip (@capacitor/core is yours already) | esbuild 0.25 --bundle --minify |
| Native | the Android SDK (about 35 KB of dex after R8) and the Swift SDK (about 280 KB of arm64 code before App Store compression); see their READMEs | measured in those repos |
| Start-up (JS side) | 3.0 ms to load the module with @capacitor/core + 0.07 ms for createStrait(...) | fresh Node 26 process, median of 25. The native side's start-up is in the Android and Swift READMEs |
examples/capacitor-app: a plain-JS Capacitor app with two screens
(Home and Product), a "Check deferred link" button and a "Log a purchase" button. CI builds it for
Android and the iOS Simulator on every pull request.
cd examples/capacitor-app && npm install
STRAIT_PUBLISHABLE_KEY=st_pub_live_… STRAIT_ENDPOINT=https://<your-handle>.strait.link npm run sync
npx cap run android # or: npx cap run ios