highlevel-app
Installation
SKILL.md
Building a GoHighLevel marketplace app
A HighLevel app is an OAuth 2.0 app installed into a location (sub-account), whose UI is a Custom Menu Link → Custom Page: an iframe pointing at your hosted SPA. Source lives in integrations/highlevel-app/. The SPA is a thin frontend over your API; the small server exists only for the OAuth exchange and webhooks.
When to use
- Triggers: 'build a GoHighLevel app', 'GHL marketplace app', 'HighLevel OAuth', 'chooselocation', 'HighLevel custom menu link', 'my GHL iframe is blank', 'submit to the GoHighLevel marketplace'.
- Install picks a location, so tokens are per sub-account; the token endpoint host differs by account and answers invalid_client when guessed wrong.
- The platform appends locationId to the iframe src, so scope all state to it; the iframe dies silently unless frame-ancestors names the HighLevel domains. Siblings: hubspot-app, monday-app, whop-app, connector-directory-submission.
The trap that wastes a day: the tenant is the location, not the account
Install does not go through a plain /authorize. It goes through /oauth/chooselocation, where the installer picks a sub-account, and the token you get back belongs to that location. An agency installs once per location, so:
- store
{ access_token, refresh_token, expires_in, locationId, companyId }keyed bylocationId, - key every piece of app state by
locationIdtoo — the platform appends?locationId=…&companyId=…to the iframesrc, and that is your tenant id, - one token per app, or per company, looks fine with a single test install and breaks the first real multi-location agency.
Rule: decide the per-location storage shape before writing the callback. Retrofitting it means re-keying every stored record.