How MyAppsTree works: technical details
This page describes what happens when someone opens an app through MyAppsTree, how the lock works, and what is not covered. For the same in plain words, see How MyAppsTree works.
The pieces
-
The dashboard at
myappstree.com: sign-in, your apps, circles and your page. -
The gateway at
name.myappstr.ee: one address for each app. It decides whether a visitor may pass and forwards the request to the app's original address. - Your app, running wherever you published it. MyAppsTree does not host it.
Apps are on a different domain from the dashboard on purpose. Apps are other people's code, and browsers treat all addresses under one domain as one site. A separate domain keeps an app away from the dashboard's sign-in.
Opening a private app
- A visitor opens
name.myappstr.ee. The gateway looks up the app. - If the visitor has no pass for this app yet, they are sent to
myappstree.com. - They sign in with Google if needed. MyAppsTree checks that they are the owner, or that their email is shared on the app directly or through a circle.
- They are sent back to the app's address with a signed code that is valid for 60 seconds. The gateway exchanges it for a pass: a cookie for that one app address, valid for 7 days.
- On every later request the gateway verifies the pass and checks access again in the database, then forwards the request. Removing someone therefore takes effect on their next request, not when the pass runs out.
Opening a public app
There is no sign-in and no pass. The gateway forwards the request straight away, and the app receives no information about who the visitor is.
What the gateway changes in a request
- It removes its own cookie, so the app never sees the pass.
-
It removes any
X-User-…andX-MyAppsTree-…header sent by the browser, so a visitor cannot fake them. -
For a private app it adds
X-User-Emailwith the Google email of the signed-in visitor. A public app gets no such header. - It adds
X-Forwarded-HostandX-Forwarded-Proto. - For a locked app it adds
X-MyAppsTree-Keywith the app's key. - In the answer, it rewrites redirects that point at the original address, so the browser stays on the MyAppsTree address.
The lock
The lock is a key shared between MyAppsTree and your app. MyAppsTree creates the key (64 characters, random)
and stores it encrypted. The gateway sends it with every request in the X-MyAppsTree-Key header.
Your app gets one check that runs before anything else:
-
It compares the
X-MyAppsTree-Keyheader with theMYAPPSTREE_KEYenvironment variable. - If the variable is not set, or the header is missing or different, the app answers with status 403 and a small page that links to its MyAppsTree address.
- If the key matches, the request continues exactly as before.
The check has to run on a server, so the app needs a server side (for example Next.js or anything with middleware). A purely static site cannot check a key. Your coding agent writes the check from the instructions MyAppsTree gives you; you do not edit the app by hand.
Environment variables
-
MYAPPSTREE_KEY: the key. It is set only at your host, as a secret, for every published environment: production and preview deployments. It is never stored on your computer, never committed, and never exposed to the browser. -
MYAPPSTREE_LOCK=off: switches the check off. It exists only in development (your local environment file or the platform's development-only variables) and is never set for a published environment.
So every published deployment is locked, and development stays open: the app on your own computer, your
tool's unpublished preview, and development builds. Where a platform has its own reliable development
signal, the check may use that instead of MYAPPSTREE_LOCK=off. The check never decides from
the request itself (host name, headers, cookies), because a visitor can fake those. When it is not certain
that the app runs in development, it stays locked.
How the key reaches your app
When you create or update a key, MyAppsTree makes a one-time link and puts it in the instructions you copy for your coding agent. The agent requests the link once and stores the answer straight at your host, so the key does not appear in the chat.
- The link works for one request and for 30 minutes.
- The answer is the key as plain text and nothing else.
- Updating the key or removing the lock cancels the link.
- If the agent cannot reach the link, it asks you for the key through a hidden input or your host's field for secrets, and you copy it with "Copy key". The key should never be pasted into a chat.
"Update key" makes a new key and a new link. Until the app has the new key, it refuses visits that come through MyAppsTree as well.
What "Check" tests
MyAppsTree sends two requests to the app's original address:
- One without the key. It must be refused.
- One with the key. It must get through.
When both are true, the app counts as locked and a padlock is shown next to it. The padlock shows the result of the last check. MyAppsTree does not check again by itself, so if the check is later removed from the app's code, the padlock stays until you press Check again. Updating the key or removing the lock takes the padlock away.
What is not covered
- All traffic to an app passes through MyAppsTree. We forward it and do not store its content, but you are trusting the service with it. See the privacy policy.
- An unlocked app is only unlisted. Anyone who learns its original address can open it there.
- Data loaded straight from the browser. An app that talks to a database directly from the visitor's browser is protected only by that database's own rules. The lock covers requests to the app's server.
- The app's own sign-in is left as it is. A private app with its own sign-in asks people to sign in twice.
- Signing out of MyAppsTree does not close apps that are already open. Each keeps its pass for up to 7 days. Removing someone's access still works at once.
For coding agents
The exact instructions a coding agent follows are public at /agents.md, and as an installable skill at /skill.md. They are the same text the dashboard gives you to copy.