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

tapfiliate-js

v0.0.1

Published

Simple wrapper for the Tapfiliate javascript integration library to help with implementation in modern frontend applications.

Downloads

7

Readme

Tapfiliate npm module

This is a simple wrapper for the Tapfiliate JavaScript integration library to help with implementation in modern frontend applications.

Table of content

Installation

With npm:

npm install tapfiliate-js

With yarn:

yarn add tapfiliate-js

Import and initialize your tracking using the init function. Get your account id from your account settings.

import Tap from "tapfiliate-js";

Tap.init(accountId);

The init function will add the Tapfiliate script to your webiste's head tag. This is needed for you to be able to use the rest of the Tap functions.

Test your integration

To test your Tapfiliate setup you can simply add ?tap_test=true at the end of your url to open the tapfiliate tester. Read more about testing your integration here.

API

This npm module mirrors the Tapfiliate JavaScript integration library and all functions from the Javascript Docs can be used with this wrapper with the only difference that the first parameter is now the function name.

e.g. instead of: tap('conversion', external id, amount, options, commission type, callback); You can now use: Tap.conversion(external id, amount, options, commission type, callback)

Init

To make the initialization easier we added the init function. Use Tap.init to initialize Tapfiliate. The function loads the tapfiliate javascript to your site's head tag and then calls the two functions Create & Detect to initialize the Tap object.

Tap.init(accountId, createOptions, createCallback, detectOptions, detectCallback);

Arguments

| Name | Value | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | accountId | String. Your account id. | | createOptions | Object. Currently no options. This argument only functions as a stub for possible future options. | | createCallback | Function. Callback, to be called after the tracking code has been initialized. In case a visitor id exists for the current visitor, tap.vids will be populated at this point. | | detectOptions | Object. See table 'detectOptions' below | | detectCallback | Function. Callback, to be called after a click is tracked. Important: This callback will only fire upon successfully tracked clicks. We are aware this is against convention. However, we're keeping it in place in order to not cause any BC breaks. The method will be deprecated in the future in favour of a new method, that uses conventional callback behaviour. For now you can pass always_callback: true in the options to make the callback always fire. In this case the callback will look as follows: function(error, result) {} |

DetectOptions

| Options | Option values | | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | cookie_domain | string. Explicitly define the domain to place the cookie on. Can be used when users land on subdomain A and later convert on subdomain B. | | referral_code | String Use this to explicitly pass a specific referral code for this click. | | referral_code_param | String. Use an alternative query parameter for the referral code, instead of ref. For example if you would like your links to look like: https://.../?via=, pass via | | always_callback | Boolean Set to true to also make your callback fire on failed tracking attempts. More info |