- Overview
- Quick start
- Experiences
- SPA documentation
- Local storage and cached state
- API queues and diagnostics
- Console helpers
- Maintenance notes
Metadata Audit is a static web application that helps Pendo teams validate subscription metadata pulled directly from the Engage API. The project offers a legacy multi-page flow and a newer SPA rebuild.
- Hosted use: The Integration API flow can run from any static host (for example, GitHub Pages) because all requests go straight to the Engage API.
- Local development:
- Serve the project from the repo root:
php -S localhost:8000
- Open
http://localhost:8000/index.htmlfor Integration API testing orhttp://localhost:8000/SPA/html/SPA.htmlfor the SPA.
- Serve the project from the repo root:
- Auth inputs: Provide an integration key with read access. Use any modern browser that supports the Fetch API.
- Purpose: Provides the original multi-page metadata audit with vanilla JS controllers.
- Entry point: Root-level HTML such as
index.html, linked workflows, andsessionStorageto carry SubID, domain, and integration key inputs across pages. - How to run: Serve the repo root (for example,
php -S localhost:8000) and openhttp://localhost:8000/index.html. - Inputs: Integration key with read access plus SubID and domain captured in the launch form.
- Outputs: Metadata field analysis first, followed by Deep Dive exports in XLSX format.
- Troubleshooting: Queue pacing, diagnostics, and Deep Dive behaviors are outlined in
SPA/docs/deep-dive.mdfor reference when requests stall.
- Purpose: Combines metadata field analysis and Deep Dive into one single-page workflow with simplified navigation.
- Entry point:
SPA/html/SPA.htmlrendered bySPA/js/spa.jswith view toggles documented inSPA/docs/spa.md. - How to run: Serve the repo root (for example,
php -S localhost:8000) and openhttp://localhost:8000/SPA/html/SPA.html. - Inputs: Integration key with read access plus SubID and domain, entered once and reused without
sessionStorage/localStoragehandoffs between views. SPA state should stay in memory (for example, module-level variables) instead of relying on browser storage. - Outputs: Unified XLSX exports along with in-browser tables aligned to SPA view definitions.
- Exports: View 4 starts with a
SPA/pdf/pdf0.htmltable of contents for the export bundle, then embedsSPA/pdf/pdf1.html(overview charts) andSPA/pdf/pdf2.html(field analysis) in an iframe for previews. View 5 reserves the Excel export workspace. - Navigation gating: The export SPA buttons (views 4 and 5) stay disabled until the metadata scan on view 3 finishes.
- Metadata refresh: Returning to view 3 after adjusting app selections on view 2 rebuilds the metadata tables so removed or newly selected apps stay in sync.
- Troubleshooting: See
SPA/docs/spa.mdfor navigation, caching rules, and common queue or progress-banner edge cases.
- Purpose: Runs targeted Engage aggregation calls for queue-driven Deep Dive exports used by both experiences.
- Entry point: Triggered from the Integration API flow or SPA Deep Dive view; detailed call flows live in
SPA/docs/deep-dive.md. - How to run: Start from either experience, then launch Deep Dive from its respective UI section to populate queues.
- Inputs: SubID, domain, integration key, and selected apps/lookback windows configured in the originating experience.
- Outputs: Aggregated metadata event summaries and XLSX downloads; SPA also surfaces queue status text alongside export progress.
- Troubleshooting: Review
SPA/docs/deep-dive.mdfor queue pacing, retries, and diagnostics, and use console helpers in the relevant experience to inspect pending calls.
- Architecture and navigation:
SPA/docs/spa.mdcovers the SPA shell, page switching, caching rules, and how to add a new view. - Deep dives and queues:
SPA/docs/deep-dive.mdcaptures detailed call sequencing, queue pacing, and diagnostics for Deep Dive and metadata fetches.
- Legacy pages:
sessionStorageentries such assubidLaunchData,appSelectionResponses,manualAppNames, andmetadataFieldRecordskeep SubID launch rows, app selections, overrides, and snapshot exports available across refreshes. Clear these keys between runs to avoid stale data. - SPA state: Do not add new
sessionStorage/localStoragedependencies. Keep SPA selections and temporary data in memory (for example,window.tableDataorwindow.FIELDTYPES.fieldTypeSelections) so a refresh resets state. - Deep Dive aggregates (
deepDiveMetaEvents): Caches Deep Dive results to avoid redundant scans. - SPA metadata aggregation summaries (
metadataAggregations): Saves SubID → App ID lookups with windowed namespace buckets for console review without rebuilding tables.
- Metadata fields and Deep Dive queues track pending and completed Engage aggregation calls so progress text stays aligned with the actual request plan.
- Deep Dive requests run with capped concurrency and staggered delays to reduce API pressure while updating pending-call summaries as windows split or retry.
- Successful metadata API responses trigger a
processAPIsummary inSPA/js/3.jsthat logs namespaces and field names per SubID/AppID pair while hydrating cached 7/30/180 lookback columns by merging the 7/23/150-day buckets (with duplicates removed) only after the full window inputs are processed. After updatingtableData,processAPIre-renders the metadata tables through the shared renderer instead of patching individual cells. - SPA metadata UI and exports only surface 7/30/180-day windows derived from the 7/23/150-day calls, with 30-day rollups built from 7 + 23 and 180-day rollups built from 7 + 23 + 150.
- The SPA "Configure Expected Values" control in view 3 opens
SPA/html/fieldtypes.html, which lists the unique metadata fields from the most complete window results available intableData(preferring 180-day data but falling back to earlier windows) so users can validate discovered names with mutually exclusive type checkboxes and a single Regex column whose button opensSPA/html/regex.htmlfor pattern entry. The regex modal title mirrors the selected field name so users can confirm which metadata attribute they are editing. Selections and saved regex patterns persist while the SPA is running and surface again when reopening the modal; inspect them viawindow.FIELDTYPES.fieldTypeSelectionswhen debugging. The modal scrolls internally so long field lists stay accessible without moving the page underneath. - SPA API calls surface failed or invalid Engage responses to the browser console to make integration issues visible without digging into cached data.
- Detailed queue mechanics, call pacing, and progress banner behavior are described in
SPA/docs/deep-dive.md.
- SPA:
window.tableDatamirrors SPA view 3 rows (lookback placeholders live underwindow7,window30, andwindow180), and updates to this array immediately re-render the four metadata tables so the DOM stays aligned with cached state.window.metadataQueueinspects or replays SPA metadata queues. - Deep Dive and legacy pages: Helpers such as
window.deepDiveData,window.metadata_visitors, andwindow.showPendingApiQueue()expose cached results and pending call states. SeeSPA/docs/deep-dive.mdfor the full list and sample invocations.
- Clear
sessionStoragebetween runs to avoid stale SubID or manual naming data. - Keep secrets out of exports; integration keys are never written to disk.
- XLSX downloads rely on ExcelJS from the CDN so browser styling persists in saved workbooks.
- Accessibility: detailed ARIA and captioning work is paused for now; prioritize core SPA behaviors before revisiting table accessibility polish.