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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tpc-check

v0.0.1

Published

Check if third-party cookies are enabled

Readme

License

TPC Check

Check if the user has enabled third-party cookies.

Third-party cookies are basically regular cookies but set from different domain. They are useful for recognizing the user's browser, and aggregate requests and data around a particular user. Unfortunately, they can be used for tracking purposes by an entity that the user hasn't agreed to, so there are a lot of users who disabled them in order to protect their privacy.

But in the same time there are certain types of software (payments, tracking services, analytics, etc.) that might need third-party cookies to work and disabling them would mean that the user won't be able to complete certain step. In such cases it is useful to have a way to check whether they are allowed or not and show message to the user explaining why they will need to enable them in order to complete what they started.

Unfortunately, there is no direct way to check whether third-party cookies are enabled or not (compared to regular cookies, for which check is very easy). This library exists exactly for these cases, mainstreaming this process and extracting this functionality in an easy to use interface.

Inner Working

There are several steps to find out whether third-party cookies are enabled:

  • Load a script from third-party domain (there is a separate backend service, that this library is communicating with which handles this) and try to set a cookie from it.
  • When the script is loaded, load another script from the same domain, which tries to retrieve the cookie that was initialy set.
  • If the retrieval is successful, then third-party cookies are enabled. If not, then they are disabled.
  • Execute the passed callback with the result from this check.

Install

npm install --save tpc-check

Example

import tpc from 'tpc-check'

tpc(enabled => {
  if (!enabled) {
    alert('Please, enable third-party cookies to proceed')
  }
})

Development and Contribution

If you discovered a bug or have a feature suggestion, feel free to create an issue on GitHub or open a Pull Request.

git clone [email protected]:citrusbyte/tpc-check.git
cd tpc-check
npm install
npm test

About Citrusbyte

Citrusbyte

This software is lovingly maintained and funded by Citrusbyte. Development is led by Dimitar Valchanov. At Citrusbyte, we specialize in solving difficult computer science problems for startups and the enterprise.

At Citrusbyte we believe in and support open source software.

Citrusbyte and the Citrusbyte logo are trademarks or registered trademarks of Citrusbyte, LLC.