Skip to content

contrib: add telemetry event schema for wallet connect funnel - #348

Merged
davedumto merged 1 commit into
Vellar-Wallet:devfrom
Elizabethxxx:issue-290-wallet-connect-telemetry-schema
Aug 31, 2026
Merged

contrib: add telemetry event schema for wallet connect funnel#348
davedumto merged 1 commit into
Vellar-Wallet:devfrom
Elizabethxxx:issue-290-wallet-connect-telemetry-schema

Conversation

@Elizabethxxx

Copy link
Copy Markdown

Summary

Defines a consistent telemetry event schema for the wallet connect funnel (start to completion) and a withConnectTelemetry decorator that emits those events around WalletConnector.connectWallet.

closes #290

What's included

  • A typed ConnectFunnelEvent union covering every step: connect_started, connect_webauthn_ceremony_started, connect_webauthn_ceremony_completed (carries the resolved keyId), connect_backend_lookup_started, connect_backend_lookup_completed (carries found), connect_session_key_rotated (schema slot for [medium] Rotate session key on passkeykit-connector re-authentication #223's rotation), and exactly one of connect_succeeded (accountId, durationMs) or connect_failed (failedAtStep, errorName, errorMessage, durationMs). Every event carries a shared connectionAttemptId so events from one call can be grouped, plus timestamp and network.
  • No event carries secret or signature material — only public identifiers (keyId, accountId) and outcome metadata.
  • withConnectTelemetry(connector, onEvent) wraps any WalletConnector (src/connector.ts) and emits the funnel through onEvent on every connectWallet() call. The hook is best-effort: a throwing handler is caught and never affects the underlying connect call. createWallet and signTransaction pass through unchanged.
  • 8 tests: full event order on success, shared connectionAttemptId/network across one call's events, connect_succeeded payload correctness, keyId propagation, connect_failed payload and failedAtStep on a thrown error, telemetry-hook-throws-but-connect-still-resolves, no instrumentation leaking into createWallet/signTransaction, and distinct connectionAttemptIds across concurrent calls.

Placement note

The issue asks for "optional event emission hooks at each step in connector.ts". Contributor PRs may only touch contrib/, so this ships as a decorator around the existing WalletConnector interface rather than editing src/passkeykit-connector.ts directly. Because the decorator can only observe the WebAuthn ceremony and backend lookup as one opaque call from outside, it emits that started/completed pair around the single connectWallet call rather than at the true internal call sites. The README and code comments call this out explicitly: a maintainer merging this can lift the emission points directly into connectWallet in src/passkeykit-connector.ts (firing at the real ceremony/lookup/rotation call sites), which would be strictly more precise than the wrapper.

Test plan

  • npx vitest run contrib/examples/issue-290-wallet-connect-telemetry — 8/8 passing
  • Standalone strict typecheck of the new files passes with no errors

…-Wallet#290)

Defines a typed event schema covering each step of the wallet connect
funnel (started, WebAuthn ceremony, backend lookup, session key
rotation, succeeded/failed), and a withConnectTelemetry decorator that
wraps any WalletConnector to emit those events around connectWallet
without modifying the connector interface. Events carry only public
identifiers and outcome metadata, never secrets or signatures. A
throwing telemetry hook never affects the underlying connect call.

closes Vellar-Wallet#290
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Elizabethxxx Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Elizabethxxx is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@davedumto
davedumto merged commit de3c3fd into Vellar-Wallet:dev Aug 31, 2026
1 of 2 checks passed
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.

2 participants