npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@out-of-the-blue-ai/pulse

v0.0.4

Published

OTB Node.js SDK for events stream

Downloads

11

Readme

OutOfTheBlue Pulse Node.js SDK

Introduction

The OutOfTheBlue Pulse Node.js SDK enables third-party analytics for Shopify stores with a headless setup.

Purpose

For headless Shopify stores, the standard Shopify App Pixel cannot be used to gather customer events. This SDK bridges that gap by enabling the collection of standard customer events in headless setups.

Key Features

  • Collects standard customer events as defined in the Shopify Web Pixels API documentation
  • Designed specifically for headless Shopify store architecture
  • Seamless integration with Node.js-based frontend applications

Getting Started

To begin using the OutOfTheBlue Pulse Node.js SDK, refer to our installation and setup guide in the following sections.

Installation

Install @out-of-the-blue-ai/pulse with npm

  npm i @out-of-the-blue-ai/pulse --save

OutOfTheBlue Pulse Integration Guide

Usage/Examples

There are two ways to push standard customer events to OutOfTheBlue Pulse:

  • Using Hydrogen Analytics UI SDK
  • Placing Pulse SDK in onClick() handlers (Coming Soon)

1. Using Hydrogen Analytics UI SDK

If the Hydrogen Analytics SDK is already installed in your frontend repository, integrating our SDK becomes much easier.

Step 1: Understand Hydrogen Analytics

Refer to the Hydrogen Analytics documentation for background information.

Step 2: Add Event Subscriptions

In the useEffect() hook, add subscriptions for the following events:

  • page_viewed
  • product_viewed
  • product_added_to_cart
  • checkout_started
  • checkout_shipping_info_submitted
  • payment_info_submitted
  • checkout_completed

Step 3: Implement Pulse SDK

Here's how to integrate the Pulse SDK:

import { useAnalytics } from '@shopify/hydrogen';
import { useEffect } from 'react';
import { pulsePush } from "@out-of-the-blue-ai/pulse";

export function ThirdPartyAnalyticsIntegration() {
  const { subscribe } = useAnalytics();
  const { ready } = register('Third Party Analytics Integration');

  useEffect(() => {
    // Standard events
    const events = [
      'page_viewed',
      'product_viewed',
      'product_added_to_cart',
      'checkout_started',
      'checkout_shipping_info_submitted',
      'payment_info_submitted',
      'checkout_completed'
    ];

    events.forEach(event => {
      subscribe(event, (data) => {
        pulsePush(event, data, "customer_event");
      });
    });

    // Mark this analytics integration as ready
    ready();
  }, []);

  return null;
}

In this component, we use the pulsePush() function to send data to OutOfTheBlue Pulse whenever a subscribed event occurs.

2. Placing Pulse SDK in onClick() handlers

This feature is coming soon. Stay tuned for updates!

Need Help?

If you encounter any issues or have questions, please refer to our documentation or contact our support team.