Quickstart (5 minutes)
You need an iPhone with Trowyn and a terminal with curl. Everything here uses test mode,
which is available immediately and never reaches users' live links.
1. Create your organization
- Go to console.trowyn.com and Create account. Confirm your email.
- Set up the authenticator code the console asks for (Trowyn itself works).
- Create an organization. It starts as pending review: test mode works now, live keys arrive once Trowyn has reviewed and approved it.
2. Get a test API key
Console → API keys → make sure the switch at the top says Test → Create key.
Copy it now: it's shown once (trw_test_…). Store it as a server secret:
export TROWYN_API_KEY='trw_test_…'
export TROWYN=https://xkxmnvnxorhwlvgcihhy.supabase.co/functions/v1
3. Link your iPhone
curl -s $TROWYN/create-link-code -H "Authorization: Bearer $TROWYN_API_KEY" \
-H 'Content-Type: application/json' -d '{"external_user_id":"me","label":"me@example.com"}'
Open the returned link_url on a computer and scan the QR with your iPhone camera, or send the
link to your phone and tap it. Trowyn opens on Link company: tap Link and use Face ID.
(Or in the console: Phones → Link a phone, which does the same thing.)
4. Send an approval
curl -s $TROWYN/create-approval -H "Authorization: Bearer $TROWYN_API_KEY" \
-H 'Content-Type: application/json' -d '{"external_user_id":"me","app_name":"Quickstart"}'
Your phone shows TEST sign-in request. The response has match_number: tap that number, then
confirm with Face ID.
5. Read the result
curl -s "$TROWYN/approval-status?id=<id from step 4>" -H "Authorization: Bearer $TROWYN_API_KEY"
"status": "approved". That's the whole integration. Next:
- In your app, do steps 3–5 from your server with the server SDK and show the QR and the number with the widget.
- Add a webhook instead of polling.
- When you're approved for live, create a live key and have users link again with a live code (test links never receive live requests). See test vs live.
// The same flow with @trowyn/server
import { Trowyn } from "@trowyn/server";
const trowyn = new Trowyn({ apiKey: process.env.TROWYN_API_KEY });
const a = await trowyn.createApproval({ externalUserId: "me", appName: "Quickstart" });
console.log("Tap", a.match_number);
const result = await trowyn.waitForApproval(a.id);
console.log(result.status); // "approved"