Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@sho-js/cpa

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sho-js/cpa

CPA Networks integration

latest
Source
npmnpm
Version
4.0.1
Version published
Maintainers
2
Created
Source

CPA Integration

This packages created fo commercial products of Wearesho Team Should be used in pair with wearesho-team/bobra-cpa back-end

Integrated:

  • SalesDoubler
  • DoAffiliate
  • LoanGate
  • Cashka
  • AdmitAd
  • PrimeLead
  • LeadsSu
  • FinLine
  • Letmeads
  • LeadGid
  • LinkProfit

Installation

Using npm

npm i --save @sho-js/cpa

Usage

Add after page loaded:

import * as Cpa from "@sho-js/cpa";

(new Cpa.Service).onLoad(new URLSearchParams(window.location.search));

Add after you identify user (LoginForm, bootstrap token found):

import * as Cpa from "@sho-js/cpa";
import Raven from "raven-js";

// configure axios baseURL and authorization token here

try {
    (new Cpa.Service(window.location.hostname)).onLogin(
        /** path to back-end should be generated here */
        (source) => `/lead/${source}`
    );
} catch (error) {
    if (process.env.NODE_ENV !== 'production') {
        throw error;
    }
    Raven.captureException(error);
}

Raven usage is optional

Parsers customization

You can override default parsers if default config is incompatible with your application. Implement ParserInterface and specify it in constructor

import * as Cpa from "@sho-js/cpa"

class CustomAdmitAdParser implements Cpa.ParserInterface {
    // implementation
}

const cookieDomain = location.host;
const cpaIntegration = new Cpa.Service(cookieDomain, {
    [Cpa.Type.admitAd]: CustomAdmitAdParser,
})

Add new CPA

To add new CPA:

License

Proprietary

Keywords

react

FAQs

Package last updated on 18 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts