Skip to content

662 piano destination#672

Merged
alexanderkirtzel merged 4 commits into
mainfrom
662-piano-destination
Jun 9, 2026
Merged

662 piano destination#672
alexanderkirtzel merged 4 commits into
mainfrom
662-piano-destination

Conversation

@alexanderkirtzel

@alexanderkirtzel alexanderkirtzel commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Piano Analytics web destination to forward walkerOS events to the Piano pa SDK
    • Support for automatic Piano script injection via loadScript option
    • Configurable site ID and collection domain settings
    • Event mapping support for page views, transactions, and custom events
  • Documentation

    • New Piano Analytics destination documentation with installation and configuration guides

@alexanderkirtzel alexanderkirtzel linked an issue Jun 9, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Too many files!

This PR contains 212 files, which is 62 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f04a51ac-652d-4e87-9b7a-adcb17679472

📥 Commits

Reviewing files that changed from the base of the PR and between e20294c and f17cab6.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (212)
  • .changeset/api-typed-surface.md
  • .changeset/batch-outcome-shutdown-fixes.md
  • .changeset/bigquery-timing-float.md
  • .changeset/browser-window-single-instance.md
  • .changeset/cli-archive-bundles.md
  • .changeset/cli-iife-browser-bundle.md
  • .changeset/codebox-toolbar-memo.md
  • .changeset/collector-foreign-dispatch-guard.md
  • .changeset/collector-public-chain-helpers.md
  • .changeset/collector-state-delivery.md
  • .changeset/config-batch-enabler.md
  • .changeset/config-credentials-field.md
  • .changeset/datalayer-source-mapping-examples.md
  • .changeset/dependency-refresh-runtime-sdks.md
  • .changeset/destination-cast-cleanup.md
  • .changeset/explorer-use-client-directive.md
  • .changeset/flow-ref-grammar.md
  • .changeset/flowstate-platform.md
  • .changeset/getenv-generic.md
  • .changeset/gethashserver-algorithm-option.md
  • .changeset/ingest-map-operator-docs.md
  • .changeset/lazy-dev-exports.md
  • .changeset/mcp-contract-and-catalog.md
  • .changeset/mcp-surface-hardening.md
  • .changeset/no-bundle-step-examples.md
  • .changeset/preview-source-and-delete.md
  • .changeset/request-cache-serialization.md
  • .changeset/require-order-independence.md
  • .changeset/runtime-trace-polling.md
  • .changeset/scoped-generic-data-attribute.md
  • .changeset/secret-manage-mcp-tool.md
  • .changeset/simulate-collector-step.md
  • .changeset/skeleton-resolved-view.md
  • .changeset/state-block.md
  • .changeset/store-format-standardization.md
  • .changeset/tag-unified-visualization.md
  • .changeset/telemetry-no-poll.md
  • .changeset/transformer-validate.md
  • .changeset/validate-multiflow-secret-scoping.md
  • .changeset/validate-schema-only-fix.md
  • apps/cli/CHANGELOG.md
  • apps/cli/package.json
  • apps/demos/react/CHANGELOG.md
  • apps/demos/react/package.json
  • apps/demos/storybook/CHANGELOG.md
  • apps/demos/storybook/package.json
  • apps/explorer/CHANGELOG.md
  • apps/explorer/package.json
  • apps/quickstart/CHANGELOG.md
  • apps/quickstart/package.json
  • apps/storybook-addon/CHANGELOG.md
  • apps/storybook-addon/package.json
  • apps/walkerjs/CHANGELOG.md
  • apps/walkerjs/package.json
  • packages/cli/CHANGELOG.md
  • packages/cli/package.json
  • packages/collector/CHANGELOG.md
  • packages/collector/package.json
  • packages/config/CHANGELOG.md
  • packages/config/package.json
  • packages/core/CHANGELOG.md
  • packages/core/package.json
  • packages/destinations/demo/CHANGELOG.md
  • packages/destinations/demo/package.json
  • packages/mcps/mcp/CHANGELOG.md
  • packages/mcps/mcp/package.json
  • packages/mcps/source-browser/CHANGELOG.md
  • packages/mcps/source-browser/package.json
  • packages/server/core/CHANGELOG.md
  • packages/server/core/package.json
  • packages/server/destinations/amplitude/CHANGELOG.md
  • packages/server/destinations/amplitude/package.json
  • packages/server/destinations/api/CHANGELOG.md
  • packages/server/destinations/api/package.json
  • packages/server/destinations/aws/CHANGELOG.md
  • packages/server/destinations/aws/package.json
  • packages/server/destinations/bing/CHANGELOG.md
  • packages/server/destinations/bing/package.json
  • packages/server/destinations/criteo/CHANGELOG.md
  • packages/server/destinations/criteo/package.json
  • packages/server/destinations/customerio/CHANGELOG.md
  • packages/server/destinations/customerio/package.json
  • packages/server/destinations/datamanager/CHANGELOG.md
  • packages/server/destinations/datamanager/package.json
  • packages/server/destinations/file/CHANGELOG.md
  • packages/server/destinations/file/package.json
  • packages/server/destinations/gcp/CHANGELOG.md
  • packages/server/destinations/gcp/package.json
  • packages/server/destinations/hubspot/CHANGELOG.md
  • packages/server/destinations/hubspot/package.json
  • packages/server/destinations/kafka/CHANGELOG.md
  • packages/server/destinations/kafka/package.json
  • packages/server/destinations/klaviyo/CHANGELOG.md
  • packages/server/destinations/klaviyo/package.json
  • packages/server/destinations/linkedin/CHANGELOG.md
  • packages/server/destinations/linkedin/package.json
  • packages/server/destinations/meta/CHANGELOG.md
  • packages/server/destinations/meta/package.json
  • packages/server/destinations/mixpanel/CHANGELOG.md
  • packages/server/destinations/mixpanel/package.json
  • packages/server/destinations/mparticle/CHANGELOG.md
  • packages/server/destinations/mparticle/package.json
  • packages/server/destinations/pinterest/CHANGELOG.md
  • packages/server/destinations/pinterest/package.json
  • packages/server/destinations/posthog/CHANGELOG.md
  • packages/server/destinations/posthog/package.json
  • packages/server/destinations/reddit/CHANGELOG.md
  • packages/server/destinations/reddit/package.json
  • packages/server/destinations/redis/CHANGELOG.md
  • packages/server/destinations/redis/package.json
  • packages/server/destinations/rudderstack/CHANGELOG.md
  • packages/server/destinations/rudderstack/package.json
  • packages/server/destinations/segment/CHANGELOG.md
  • packages/server/destinations/segment/package.json
  • packages/server/destinations/slack/CHANGELOG.md
  • packages/server/destinations/slack/package.json
  • packages/server/destinations/snapchat/CHANGELOG.md
  • packages/server/destinations/snapchat/package.json
  • packages/server/destinations/sqlite/CHANGELOG.md
  • packages/server/destinations/sqlite/package.json
  • packages/server/destinations/tiktok/CHANGELOG.md
  • packages/server/destinations/tiktok/package.json
  • packages/server/destinations/twitter/CHANGELOG.md
  • packages/server/destinations/twitter/package.json
  • packages/server/sources/aws/CHANGELOG.md
  • packages/server/sources/aws/package.json
  • packages/server/sources/express/CHANGELOG.md
  • packages/server/sources/express/package.json
  • packages/server/sources/fetch/CHANGELOG.md
  • packages/server/sources/fetch/package.json
  • packages/server/sources/gcp/CHANGELOG.md
  • packages/server/sources/gcp/package.json
  • packages/server/stores/fs/CHANGELOG.md
  • packages/server/stores/fs/package.json
  • packages/server/stores/gcs/CHANGELOG.md
  • packages/server/stores/gcs/package.json
  • packages/server/stores/s3/CHANGELOG.md
  • packages/server/stores/s3/package.json
  • packages/server/stores/sheets/CHANGELOG.md
  • packages/server/stores/sheets/package.json
  • packages/server/transformers/bot/CHANGELOG.md
  • packages/server/transformers/bot/package.json
  • packages/server/transformers/file/CHANGELOG.md
  • packages/server/transformers/file/package.json
  • packages/server/transformers/fingerprint/CHANGELOG.md
  • packages/server/transformers/fingerprint/package.json
  • packages/transformers/demo/CHANGELOG.md
  • packages/transformers/demo/package.json
  • packages/transformers/ga4/CHANGELOG.md
  • packages/transformers/ga4/package.json
  • packages/transformers/validate/CHANGELOG.md
  • packages/transformers/validate/package.json
  • packages/web/core/CHANGELOG.md
  • packages/web/core/package.json
  • packages/web/destinations/amplitude/CHANGELOG.md
  • packages/web/destinations/amplitude/package.json
  • packages/web/destinations/api/CHANGELOG.md
  • packages/web/destinations/api/package.json
  • packages/web/destinations/clarity/CHANGELOG.md
  • packages/web/destinations/clarity/package.json
  • packages/web/destinations/d8a/CHANGELOG.md
  • packages/web/destinations/d8a/package.json
  • packages/web/destinations/fullstory/CHANGELOG.md
  • packages/web/destinations/fullstory/package.json
  • packages/web/destinations/gtag/CHANGELOG.md
  • packages/web/destinations/gtag/package.json
  • packages/web/destinations/heap/CHANGELOG.md
  • packages/web/destinations/heap/package.json
  • packages/web/destinations/hotjar/CHANGELOG.md
  • packages/web/destinations/hotjar/package.json
  • packages/web/destinations/linkedin/CHANGELOG.md
  • packages/web/destinations/linkedin/package.json
  • packages/web/destinations/matomo/CHANGELOG.md
  • packages/web/destinations/matomo/package.json
  • packages/web/destinations/meta/CHANGELOG.md
  • packages/web/destinations/meta/package.json
  • packages/web/destinations/mixpanel/CHANGELOG.md
  • packages/web/destinations/mixpanel/package.json
  • packages/web/destinations/optimizely/CHANGELOG.md
  • packages/web/destinations/optimizely/package.json
  • packages/web/destinations/piano/CHANGELOG.md
  • packages/web/destinations/piano/package.json
  • packages/web/destinations/pinterest/CHANGELOG.md
  • packages/web/destinations/pinterest/package.json
  • packages/web/destinations/piwikpro/CHANGELOG.md
  • packages/web/destinations/piwikpro/package.json
  • packages/web/destinations/plausible/CHANGELOG.md
  • packages/web/destinations/plausible/package.json
  • packages/web/destinations/posthog/CHANGELOG.md
  • packages/web/destinations/posthog/package.json
  • packages/web/destinations/segment/CHANGELOG.md
  • packages/web/destinations/segment/package.json
  • packages/web/destinations/snowplow/CHANGELOG.md
  • packages/web/destinations/snowplow/package.json
  • packages/web/destinations/tiktok/CHANGELOG.md
  • packages/web/destinations/tiktok/package.json
  • packages/web/sources/browser/CHANGELOG.md
  • packages/web/sources/browser/package.json
  • packages/web/sources/cmps/cookiefirst/CHANGELOG.md
  • packages/web/sources/cmps/cookiefirst/package.json
  • packages/web/sources/cmps/cookiepro/CHANGELOG.md
  • packages/web/sources/cmps/cookiepro/package.json
  • packages/web/sources/cmps/usercentrics/CHANGELOG.md
  • packages/web/sources/cmps/usercentrics/package.json
  • packages/web/sources/dataLayer/CHANGELOG.md
  • packages/web/sources/dataLayer/package.json
  • packages/web/sources/demo/CHANGELOG.md
  • packages/web/sources/demo/package.json
  • packages/web/sources/session/CHANGELOG.md
  • packages/web/sources/session/package.json
  • website/CHANGELOG.md
  • website/package.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces the Piano Analytics web destination for walkerOS, enabling forwarding of processed events to Piano's pa SDK. The implementation includes type definitions, initialization and event push logic with optional script injection, comprehensive tests and examples, and full package configuration with documentation.

Changes

Piano Analytics Web Destination

Layer / File(s) Summary
Type system and validation schemas
packages/web/destinations/piano/src/types/index.ts, packages/web/destinations/piano/src/schemas/*
PianoAnalytics SDK interface, Settings (site/collectDomain), and Env with optional window.pa; Zod schemas for configuration validation.
Destination initialization and event push
packages/web/destinations/piano/src/index.ts
destinationPiano exported with init (optional script injection, SDK resolution, conditional configuration) and push (event forwarding via pa.sendEvent).
Integration tests and step examples
packages/web/destinations/piano/src/__tests__/stepExamples.test.ts, packages/web/destinations/piano/src/index.test.ts, packages/web/destinations/piano/src/examples/*
Integration tests validating init/push flows and script injection; example environments and step examples demonstrating page view, purchase, and custom event mappings.
Build, packaging, and development exports
packages/web/destinations/piano/jest.config.mjs, packages/web/destinations/piano/tsconfig.json, packages/web/destinations/piano/tsup.config.ts, packages/web/destinations/piano/package.json, packages/web/destinations/piano/src/dev.ts
Jest/TypeScript/tsup configuration; package metadata with subpath exports for root, examples, dev, and schema artifacts; dev module re-exports.
Documentation
packages/web/destinations/piano/README.md, packages/web/destinations/piano/LICENSE, website/docs/destinations/web/piano.mdx, .changeset/piano-web-destination.md
MIT license, destination README with installation and quick-start examples, website documentation with integrated/bundled setup modes, and changelog entry.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🎹 A new piano plays its tune so bright,
Forwarding events through the SDK's light,
With types well-defined and tests in place,
Piano Analytics finds its rightful space! 🚀

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title '662 piano destination' is vague and generic, using a ticket number followed by a feature name without clearly conveying what specific change was made. Consider revising the title to be more descriptive, such as 'Add Piano Analytics web destination' to clearly indicate the primary change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 662-piano-destination

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/web/destinations/piano/src/index.ts (1)

49-54: ⚡ Quick win

Consider guarding against duplicate script injection.

The addScript function doesn't check whether the Piano script is already present in the DOM. While destination init is typically called only once, adding a guard would make the code more resilient to repeated initialization.

🔍 Proposed defensive check
 function addScript(src = SCRIPT_SRC) {
   if (typeof document === 'undefined') return;
+  if (document.querySelector(`script[src="${src}"]`)) return;
   const script = document.createElement('script');
   script.src = src;
   document.head.appendChild(script);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/web/destinations/piano/src/index.ts` around lines 49 - 54, The
addScript function can append duplicate Piano script tags; modify addScript (and
reference SCRIPT_SRC) to first search the document (e.g., document.querySelector
or getElementsByTagName) for an existing script whose src matches the provided
src (or a unique id attribute) and if found return that existing element instead
of creating/appending a new one; only create and append a script element when no
matching script is present to prevent duplicate injections on repeated init
calls.
packages/web/destinations/piano/src/__tests__/stepExamples.test.ts (1)

23-29: 💤 Low value

Consider strengthening type guards for Config and Rule.

The type guards isConfig and isRule only verify that the value is an object, without validating any specific properties. This means any object (including {}) would pass validation. While the current usage has safe fallbacks, more robust guards would improve type safety and catch malformed example data earlier.

♻️ Suggested refinement
 function isConfig(value: unknown): value is Config {
-  return isObject(value);
+  return (
+    isObject(value) &&
+    (value.settings === undefined || isObject(value.settings)) &&
+    (value.mapping === undefined || isObject(value.mapping))
+  );
 }

 function isRule(value: unknown): value is Rule {
-  return isObject(value);
+  return (
+    isObject(value) &&
+    (value.name === undefined || typeof value.name === 'string')
+  );
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/web/destinations/piano/src/__tests__/stepExamples.test.ts` around
lines 23 - 29, The current type guards isConfig and isRule only check for an
object shape and should be strengthened to validate required properties: update
isConfig(value) to verify expected Config properties (e.g., presence and types
of keys like client, apiKey, or whatever fields Config defines) and update
isRule(value) to verify required Rule properties (e.g., id, match, actions or
the actual properties in your Rule type). Modify the guards to first ensure
isObject(value) then check typeof/Array.isArray checks for those specific fields
so malformed objects (like {}) are rejected; keep the functions named isConfig
and isRule so callers (e.g., tests in stepExamples.test.ts) continue to use them
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/web/destinations/piano/src/__tests__/stepExamples.test.ts`:
- Around line 23-29: The current type guards isConfig and isRule only check for
an object shape and should be strengthened to validate required properties:
update isConfig(value) to verify expected Config properties (e.g., presence and
types of keys like client, apiKey, or whatever fields Config defines) and update
isRule(value) to verify required Rule properties (e.g., id, match, actions or
the actual properties in your Rule type). Modify the guards to first ensure
isObject(value) then check typeof/Array.isArray checks for those specific fields
so malformed objects (like {}) are rejected; keep the functions named isConfig
and isRule so callers (e.g., tests in stepExamples.test.ts) continue to use them
unchanged.

In `@packages/web/destinations/piano/src/index.ts`:
- Around line 49-54: The addScript function can append duplicate Piano script
tags; modify addScript (and reference SCRIPT_SRC) to first search the document
(e.g., document.querySelector or getElementsByTagName) for an existing script
whose src matches the provided src (or a unique id attribute) and if found
return that existing element instead of creating/appending a new one; only
create and append a script element when no matching script is present to prevent
duplicate injections on repeated init calls.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 74e40f13-7f98-4003-8c47-b20d072ca3c8

📥 Commits

Reviewing files that changed from the base of the PR and between 7aa67ca and e20294c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (20)
  • .changeset/piano-web-destination.md
  • packages/web/destinations/piano/LICENSE
  • packages/web/destinations/piano/README.md
  • packages/web/destinations/piano/jest.config.mjs
  • packages/web/destinations/piano/package.json
  • packages/web/destinations/piano/src/__tests__/stepExamples.test.ts
  • packages/web/destinations/piano/src/dev.ts
  • packages/web/destinations/piano/src/examples/env.ts
  • packages/web/destinations/piano/src/examples/index.ts
  • packages/web/destinations/piano/src/examples/step.ts
  • packages/web/destinations/piano/src/index.test.ts
  • packages/web/destinations/piano/src/index.ts
  • packages/web/destinations/piano/src/schemas/index.ts
  • packages/web/destinations/piano/src/schemas/mapping.ts
  • packages/web/destinations/piano/src/schemas/settings.ts
  • packages/web/destinations/piano/src/types/index.ts
  • packages/web/destinations/piano/tsconfig.json
  • packages/web/destinations/piano/tsup.config.ts
  • skills/walkeros-create-transformer/templates/validation/index.test.ts
  • website/docs/destinations/web/piano.mdx

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@alexanderkirtzel alexanderkirtzel merged commit 7a6c24f into main Jun 9, 2026
1 check passed
@alexanderkirtzel alexanderkirtzel deleted the 662-piano-destination branch June 9, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Piano destination

1 participant