How gohighlevel/ghl-marketplace-app-template works
This repository is a GoHighLevel Marketplace app template: an Express server handles OAuth installation, example company/location API requests, webhooks, SSO decryption, and serves a Vue custom-page UI. The principal flow exchanges an authorization code for installation tokens, keeps tokens in an in-memory model, then uses them for authenticated API calls. The UI can request encrypted SSO data from its parent frame and submit it to the server for decryption. Connections reflect README statements or shown calls; the UI/server wiring is documented, while persistent storage is not present.
Main entry points: index.ts HTTP routes · ghl.ts API client · index.js SSO browser helper · App.vue Vue app
Components 17
Express Server
- HTTP routes
src/index.ts - Static UI serving
src/index.ts
GHL Integration
- OAuth handling
src/ghl.ts - API client
src/ghl.ts - Location token exchange
src/ghl.ts - SSO decryption
src/ghl.ts
Custom Page UI
- Vue app
src/ui/src/App.vue - UI bootstrap
src/ui/src/main.js - SSO browser helper
src/ui/src/ghl/index.js - Welcome view
src/ui/src/components/HelloWorld.vue
Installation State
- Installation tokens
src/model.ts
Other components
- GHL Marketplace
- Browser / iframe
- GoHighLevel API
- GHL OAuth service
- GHL parent app
- Webhook sender
Connections 25
- GHL Marketplace → HTTP routes: starts authorization
README.md - HTTP routes → OAuth handling: handles code
src/index.ts - OAuth handling → GHL OAuth service: exchanges code
src/ghl.ts - OAuth handling → Installation tokens: saves installation
src/ghl.ts - HTTP routes → API client: requests company data
src/index.ts - HTTP routes → API client: requests location data
src/index.ts - API client → Installation tokens: reads and updates tokens
src/ghl.ts - API client → GoHighLevel API: sends authenticated requests
src/ghl.ts - HTTP routes → Location token exchange: requests location token
src/index.ts - Location token exchange → GoHighLevel API: exchanges company token
src/ghl.ts - Location token exchange → Installation tokens: saves location install
src/ghl.ts - API client → GHL OAuth service: refreshes token
src/ghl.ts - GHL OAuth service → Installation tokens: returns refreshed tokens
- Webhook sender → HTTP routes: posts events
README.md - HTTP routes → SSO decryption: decrypts submitted key
src/index.ts - GHL parent app → SSO browser helper: sends SSO data
src/ui/src/ghl/index.js - SSO browser helper → GHL parent app: requests SSO data
src/ui/src/ghl/index.js - SSO browser helper → HTTP routes: posts key for decryption
src/ui/src/ghl/index.js - SSO decryption → HTTP routes: returns decrypted data
src/index.ts - UI bootstrap → Vue app: mounts
src/ui/src/main.js - UI bootstrap → SSO browser helper: registers helper
src/ui/src/main.js - Vue app → SSO browser helper: requests user data
src/ui/src/App.vue - Vue app → Welcome view: renders
src/ui/src/App.vue - Browser / iframe → Static UI serving: loads custom page
README.md - Static UI serving → Vue app: serves UI assets
README.md