This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Templafy App Connector Library is a reference implementation for integrating Templafy's document composer into third-party applications via browser-based PostMessage API communication. The integration operates entirely client-side with no backend communication required.
# All commands run from examples/app-connector/
cd examples/app-connector
npm install # Install dependencies (mkcert, serve-handler)
npm start # Start HTTPS server at https://localhost:3000No build, test, or lint scripts—this is a minimal demonstration example.
This is a focused library within the Templafy meta-repository. The implementation lives in examples/app-connector/:
- app-connector.js — Core integration library (IIFE module pattern)
- index.js — HTTPS dev server with self-signed certificates
- index.html — Test harness UI
templafy.getDocumentUrl(popupUrl, data) → Promise<string>Opens Templafy popup, passes contextual JSON data, returns document URL when generation completes.
PostMessage-based workflow between host app and Templafy popup:
- Host opens popup → 2. Templafy sends
ready→ 3. Host sendscontent(JSON) → 4. User generates document → 5. Templafy sendsdocument(URL) → 6. Host closes popup
Branches must match: ^(feature/[0-9]+-|experiment/[a-z]+/)[A-Z0-9]
Examples:
feature/12345-Add_new_featureexperiment/auth/New_auth_flow
- ESLint validation enabled for JS/TS files
- Auto-fix on save via ESLint
- Format on save disabled (rely on ESLint)
Azure Pipelines builds on master branch commits and mirrors to GitHub (https://github.com/templafy/AppConnectorLibrary). Code ownership is managed by the Orange team with auto-review policies.
This project uses CLAUDE.md files in subdirectories for detailed module documentation:
examples/CLAUDE.md— Examples layer overviewexamples/app-connector/CLAUDE.md— Detailed implementation notes, key patterns, Salesforce LWS compatibility
Refer to these files for implementation-specific guidance.