Automates the client onboarding process for MoeGo-based pet service businesses. When a new appointment is created in MoeGo, this tool retrieves the client's unique agreement signing links and card-on-file link, generates a personalized token-based landing page URL, and emails it to the business owner — reducing manual link generation and delivery to a single step.
- Listens for
APPOINTMENT_CREATEDwebhook events from MoeGo - Detects first-time clients via the MoeGo Appointments API — skips returning clients automatically
- Retrieves per-client agreement sign links and card-on-file link via MoeGo API
- Generates a unique, expiring token URL pointing to a personalized client landing page
- Shortens the token URL via Short.io and emails it to the business owner for delivery
- Landing page renders the client's onboarding steps — agreements, card on file, and vaccination record upload
- Vaccination records uploaded directly to Google Drive, prefixed with the client's name
- Graceful failure handling — partial failures email the business owner with recovery details and the customer's MoeGo ID
- Runtime: Node.js >= 20
- Language: TypeScript
- Testing: Vitest
- Apps Script: Google Apps Script via Clasp
- Linting: ESLint (Airbnb config)
- CI/CD: GitHub Actions
- Node.js >= 20
- pnpm >= 9
- A Google account with Apps Script access and the Apps Script API enabled
- Clasp installed and configured — see Clasp Setup
- A MoeGo account with API access and a Customer Success Manager-issued API key
- A Google Sheet and Google Drive folder — see Sheet & Drive Setup
- A Short.io account with an API key and custom domain — see Short.io Setup
-
Clone the repository:
git clone https://github.com/scottgilmoredev/moego-onboarding.git cd moego-onboarding -
Install dependencies:
pnpm install
-
Set up Clasp — see Clasp Setup
pnpm run testpnpm run buildsrc/
┣ webhook/ # MoeGo webhook receiver and validation
┣ moego/ # MoeGo API client (agreements, appointments, customer data)
┣ token/ # Per-client token generation, storage, and expiry
┣ sheet/ # Google Sheets client for client row writes
┣ shortener/ # Short.io URL shortening
┣ email/ # Email delivery to business owner
┣ types/ # Shared TypeScript types
┣ utils/ # Shared utilities and helpers
┣ templates/ # HTML templates for landing page and error page
┣ server.ts # Apps Script web app entrypoint (doPost, doGet, uploadVaccinationRecord)
- GitHub Actions runs linting, tests, and build on every push and pull request
See Milestones for planned enhancements and future development.