Skip to content

fix(meta-pixel): refine fbq type definitions #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2025

Conversation

tsukiyama-3
Copy link
Contributor

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR refactors the Meta Pixel (fbq) integration to improve type safety and developer experience.

  • Adds explicit types for each valid fbq call pattern
  • Adds support for additional Meta Pixel call patterns
    • trackSingle
    • trackSingleCustom
    • consent
  • Adds a fallback [string, ...any[]] signature at the end to preserve compatibility with undocumented or custom usages
  • Makes contents in EventObjectProperties optional to prevent type errors in common usage
  • Updates documentation to reflect the new types

References

https://developers.facebook.com/docs/meta-pixel/advanced
https://developers.facebook.com/docs/meta-pixel/implementation/gdpr/

Copy link

vercel bot commented Jun 6, 2025

@tsukiyama-3 is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@harlan-zw harlan-zw changed the title chore(meta-pixel): refine fbq type definitions fix(meta-pixel): refine fbq type definitions Jun 7, 2025
@harlan-zw
Copy link
Collaborator

Awesome, thanks for your work on this, it's much better

@harlan-zw harlan-zw merged commit 3ba8a98 into nuxt:main Jun 7, 2025
1 of 3 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