Account Health
This recipe checks that each profile is still signed in to its own account and reads a few numbers from it (followers, notifications, orders). Run it on a schedule to find a signed-out account before you need it.
It only reads your own account: it never signs in for you, never sees a password, and never posts, likes, follows or sends messages. You sign in once yourself, in the profile’s window; the profile keeps that session.
Script and prompt: solutions/account-health on GitHub.
Set it up
Section titled “Set it up”Try it first with no account (the built-in demo entry):
-
Paste
script.tsinto Veilus Flow → Scripts and approve it. See Scripts. -
On a profile, add the profile variable
PLATFORM=demo. -
Run it. The profile is signed out, so the run prints
"status":"logged_out". -
Open this link in that profile to “sign in” (it sets a cookie that lasts 30 days, like a real sign-in, so it survives the profile restarting), then run again:
"status":"logged_in"with asessionmetric.https://httpbin.org/response-headers?Set-Cookie=veilus_demo_session%3D1%3B+Max-Age%3D2592000%3B+Path%3D%2FThis link signs out again:
https://httpbin.org/cookies/delete?veilus_demo_session
For your own accounts:
- Sign in to your account in the profile’s window, once.
- Set the profile variable
PLATFORMto a key ofPLATFORMSinscript.ts. SetURLif the page differs (your store’s admin, your own profile page). - Approve the script and put it on a schedule across all your profiles.
Only the demo entry ships today. You add another platform by measuring its selectors by hand and adding an entry to PLATFORMS (see the README in the repo), or by letting Claude do it with prompt.md.
What a run prints
Section titled “What a run prints”RESULT {"platform":"demo","status":"logged_out","metrics":{}}Signed in:
RESULT {"platform":"demo","status":"logged_in","metrics":{"session":{"value":1,"raw":"{\n \"cookies\": {\n \"veilus_demo_sessio"}}}value is the first number in the element’s text; raw keeps up to 40 characters of the text as it was (so 1.2K is still readable).
- Exit code 0: the page was read, signed in or not, and any alert was delivered.
- Exit code 1: the page did not load,
PLATFORMis wrong, or a signed-in page did not show a metric. It also means the webhook did not accept the alert (theRESULTline is still printed).
A run that exits 1 with metric … not found means the site changed its page: update that entry in PLATFORMS.
Change it
Section titled “Change it”- Profile variable
PLATFORM(required): which entry ofPLATFORMSto check. - Profile variable
URL(optional): the page to read, when it differs from the entry’s default. - Profile variable
WEBHOOK_URL(optional): a webhook URL that accepts JSON. It receives a message when the status islogged_out. The body carriestext(read by Slack) andcontent(read by Discord). - Another site: add an entry to
PLATFORMSwith the page, a selector that only exists when signed in, and a selector per number. - Other numbers: add a key to that platform’s
metrics.