wristkit.
· docs

iOS Shortcut setup

Install the wristkit Shortcut on your iPhone and start syncing your Apple Health data.

Download the Shortcut

Open this link on your iPhone:

plaintext
https://www.icloud.com/shortcuts/cb23e99ad6bd45c9b09e45b444ead0f0

Tap Add Shortcut when the prompt shows up.

iCloud import screen for the wristkit shortcut with the Add Shortcut button
Tap Add Shortcut to import it

Configure the Shortcut

After it is added, open the Shortcut and edit two fields:

URL, the sync endpoint of your Next.js app:

plaintext
https://your-site.com/api/wristkit-sync

API Key, the same value you put in WRISTKIT_API_KEY in your .env.local.

Test it

Run the Shortcut once by hand. It will:

  1. Read Active Energy, Exercise Minutes and Step Count from Apple Health for today
  2. POST a JSON payload to your /api/wristkit-sync endpoint
  3. Show a success or failure notification on your phone

If it works, you should see new rows in your Supabase wristkit_samples table within a few seconds.

Set up automation

To sync every day on its own, create an iOS Automation:

  1. Open the Shortcuts app and go to the Automation tab
  2. Tap +, then Time of Day
  3. Set the time to 23:59 every day
  4. Add the action Run Shortcut and pick wristkit Sync
  5. Turn off "Ask Before Running"
Shortcuts app Automation tab with the plus button highlighted
Automation tab, tap +
New personal automation trigger list
Choose Time of Day
Time of Day picker set to repeat daily
Set the time, repeat daily
Action picker choosing the wristkit shortcut to run
Run Shortcut, pick wristkit Sync

Payload format

The Shortcut sends a flat JSON dictionary with today's three Apple Health values:

json
{
  "steps": 12340,
  "moveKcal": 544,
  "exerciseMin": 80
}

The route handler stamps recorded_at with the ingest time and expands these into one row per metric in wristkit_samples.

Troubleshooting

401 Unauthorized: your API key does not match WRISTKIT_API_KEY. Double check both values.

429 Too Many Requests: the route handler limits each IP to 30 requests every 5 minutes. The Shortcut should only fire once a day, so if you hit this you are probably retrying too fast. Wait the Retry-After seconds and try again.

Network error: make sure your site is reachable from the public internet, not only on localhost.

No data in components: check that the Supabase table actually has rows. TodayActivityCard looks for today's data in the timezone you pass to loadTodayActivity({ tz }). Without a tz it defaults to UTC, so on Vercel that may not match your local "today".

Active theme: Ivy, dark mode.