How sagar7993/gatsby-plugin-pinterest-twitter-facebook works
Project type and purpose
• This is an open-source Gatsby plugin (a Node module) designed to inject Pinterest, Twitter, and Facebook JavaScript widgets into a Gatsby-built website at runtime.
• Its primary role is to hook into Gatsby’s browser APIs, wait for a configurable delay, and then load the three social SDKs so that end users can save, follow, or like content.
File structure
• Top-level files:
– gatsby-browser.js: uses Gatsby’s browser APIs to initialize the plugin on the client side.
– index.js: entry point that wires up plugin options and exports any Gatsby hooks.
– package.json: declares dependencies and plugin metadata.
– src/utils/index.js: helper functions (e.g., script loader, DOM query utilities).
• Configuration and contribution docs (.github/, CODE_OF_CONDUCT, CONTRIBUTING, README) support open-source collaboration.
README for additional insights
• The README describes plugin options for each service (enable/disable flags, selectors, dimensions, accessibility tweaks).