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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@newrelic/video-core

v4.0.2

Published

New Relic video tracking core library

Downloads

628

Readme

Community Project header

New Relic Video Core - JavaScript

The New Relic video tracking core library is the base for all video trackers in the browser platform. It contains the classes and core mechanisms used by the player specific trackers. It segregates the events into different event types based on action, such as video-related events going to VideoAction, ad-related events to VideoAdAction, errors to VideoErrorAction, and custom actions to VideoCustomAction.

Registering Trackers

Any browser-based video tracker can extend the VideoTracker class and use its core functionality.

To initialize a tracker, create an instance of your specific tracker class:

const options = {
  info: {
    licenseKey: "xxxxxxxxxxx",
    beacon: "xxxxxxxxxx",
    applicationId: "xxxxxxx",
  },
};

// User can get the `info` object by completing the onboarding process on New Relic.
const tracker = new VideoSpecificTracker(player, options);

Some of the APIs exposed and commonly used are:

  • tracker.setUserId("userId") — Set the user ID.
  • tracker.setHarvestInterval(30000) — Set the harvest interval time (in milliseconds).
  • tracker.setOptions({ customData: { key: value } }) — Set custom options or data.
  • tracker.sendCustom("CustomEvent", { data: "custom-test" }) — Send a custom event.

Any event emitted by the tracker will be sent to New Relic and processed according to its type.

Once the tracker is added, any event it emits will be sent to New Relic and processed by the following functions:

tracker.sendVideoAction("VideoEvent", { data: 1 });
tracker.sendVideoAdAction("AdEvent", { data: "test-1" });
tracker.sendVideoErrorAction("ErrorEvent", { data: "error-test" });
tracker.sendVideoCustomAction("CustomEvent", { data: "custom-test" });

Data Model

To understand which actions and attributes are captured and emitted by the tracker under different event types, see DataModel.md.

Documentation

All classes are documented using autodocs. The documents, generated with jsdoc, can be found in the documentation directory of the current repo.

Support

New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub.

We encourage you to bring your experiences and questions to the Explorers Hub where our community members collaborate on solutions and new ideas.

Community

New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:

https://discuss.newrelic.com/t/video-core-js-tracker/100303

Issues / enhancement requests

Issues and enhancement requests can be submitted in the Issues tab of this repository. Please search for and review the existing open issues before submitting a new issue.

Contributing

Contributions are encouraged! If you submit an enhancement request, we'll invite you to contribute the change yourself. Please review our Contributors Guide.

Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at [email protected].

License

This project is distributed under the Apache 2.0 License.

The video-core also uses source code from third-party libraries. Full details on which libraries are used and the terms under which they are licensed can be found in the third-party notices document.