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

@audienceproject/data-web

v1.4.0

Published

AudienceProject Data services for your websites

Downloads

134

Readme

AudienceProject Data Web

AudienceProject Data services for your websites.

Installation

  1. Install NPM package:

    npm install --save @audienceproject/data-web
  2. Load package into your application:

    • With script tag:

      <script src="path/to/dist/audienceproject-data-web.js"></script>
    • With ES6 module:

      import AudienceProjectData from '@audienceproject/data-web';
    • With CommonJS module:

      var AudienceProjectData = require('@audienceproject/data-web');
    • With AMD module:

      define(['path/to/audienceproject-data-web'], function (AudienceProjectData) {});

API

Fetch AudienceProject Data

With callback:

AudienceProjectData.fetch(customerId, options, callback);

Promise based:

AudienceProjectData.fetch(customerId).promise()
    .then(callbackSuccess)
    .catch(callbackError);

Arguments

  • customerId (string): Your AudienceProject customer ID.
  • options (Object): Optional options.
  • options.allowStorageAccess=true (boolean): If we can read or write to localStorage.
  • options.allowPersonalisation=true (boolean): If we can use personalisation for user (read cookies and user identifiers).
  • options.gdprApplies=null (boolean): If GDPR applies to user.
  • options.consentString='' (string): Consent string to prediction requests.
  • options.integrateWithCmp=false (boolean): Should we integrate with CMP to override storage and personalisation access, GDPR status and consent string.
  • options.waitForCmpConsent=false (boolean): Should we wait for explicit CMP consent before firing timeout.
  • options.requestParams={} (Object): Extra request params or information about user.
  • options.timeout=1000 (number): Timeout in milliseconds when result needs to be returned since invocation.
  • options.addStatusKey=false (boolean): Should status field be added into keyValues result.
  • options.cacheType='' (string): Type of cache, can be localStorage or memory.
  • options.cacheKey='url,allowPersonalisation,requestParams' (string): Comma separated list of cache key params.
  • options.cacheTime=86400 (number): Number of seconds response should be cached in case of options.cacheType is not empty.
  • options.requestDomains (Object): Request domains.
  • options.requestDomains.regular='pdw-usr.userreport.com' (Object): Request domain for regular requests.
  • options.requestDomains.nonPersonalised='dnt-userreport.com' (Object): Request domain for non-personalised requests.
  • options.debug=false (boolean): Enable debug logging.
  • callback (Function): Optional callback handler.

Utils

Send data to Google Publisher Tag

AudienceProjectData.fetch(customerId, options, AudienceProjectData.utils.sendDataToGooglePublisherTag);

Compatibility

We are supporting all modern and legacy browsers starting with Internet Explorer 10, Firefox 27, Chrome 22. Promise polyfill is required if you want to use promise-based callback with Internet Explorer and legacy versions of Firefox/Chrome, see compatibility table.

Content Security Policy

Following directive is required to support CSP:

connect-src https://pdw-usr.userreport.com https://dnt-userreport.com