Skip to content

Latest commit

 

History

History
69 lines (43 loc) · 2.34 KB

File metadata and controls

69 lines (43 loc) · 2.34 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

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.

Commands

# 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:3000

No build, test, or lint scripts—this is a minimal demonstration example.

Architecture

Repository Structure

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

Public API

templafy.getDocumentUrl(popupUrl, data)  Promise<string>

Opens Templafy popup, passes contextual JSON data, returns document URL when generation completes.

Communication Protocol

PostMessage-based workflow between host app and Templafy popup:

  1. Host opens popup → 2. Templafy sends ready → 3. Host sends content (JSON) → 4. User generates document → 5. Templafy sends document (URL) → 6. Host closes popup

Development Standards

Branch Naming

Branches must match: ^(feature/[0-9]+-|experiment/[a-z]+/)[A-Z0-9]

Examples:

  • feature/12345-Add_new_feature
  • experiment/auth/New_auth_flow

Code Style

  • ESLint validation enabled for JS/TS files
  • Auto-fix on save via ESLint
  • Format on save disabled (rely on ESLint)

CI/CD

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.

Multi-Level Documentation

This project uses CLAUDE.md files in subdirectories for detailed module documentation:

  • examples/CLAUDE.md — Examples layer overview
  • examples/app-connector/CLAUDE.md — Detailed implementation notes, key patterns, Salesforce LWS compatibility

Refer to these files for implementation-specific guidance.