New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

offerpop

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

offerpop

An isomorphic Javascript HTTP client for Offerpop's REST APIs.

  • 0.1.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Offerpop

This module is a simple, isomorphic JS library to interact with Offerpop's REST APIs. It can be used both in the browser using a bundler like Browserify or Webpack or on the server using Node.

Code Example

var Ugc = require('offerpop').Ugc;
var ugc = new Ugc('OFFERPOP_ACCESS_TOKEN');

ugc
  .getById('37152902')
  .then(function (response) {
    // do stuff
  });

Motivation

I built this library so that communication with Offerpop's Content API and Conversion Unit API could be abstracted out and easily used on the browser and server side.

Installation

npm install --save offerpop

API Reference

The module exports two classes whose instance methods return an axios Promise.

new Ugc(String accessToken)

getById (String id [,Object params])

TypeParameterDescription
Stringidid of the user generated content
Objectparamsquery params of the GET request

getCollection (String id [, Object params, Boolean collectAllPages])

TypeParameterDescription
Stringidid of the collection
Objectparamsquery params of the GET request
BooleancollectAllPagesboolean to decide whether to fetch the whole collection

new ActiateUnit(String accessToken)

getById (String id)

TypeParameterDescription
Stringidid of the activate unit

getAll ()

new Content(String accessToken)

getItems (Object params)

TypeParameterDescription
Objectparamsquery params of the GET request

Tests

To run the tests for this repo you'll need to setup an .env file with the following environment variable.

OFFERPOP_ACCESS_TOKEN=*** YOUR ACCESS TOKEN HERE ***

Then, run the following command.

npm run test-dev

Contributors

Vincenzo Merolla

Credits

Shout out to Matt Zabriskie for easing the build of this module with axios.

License

MIT

Keywords

FAQs

Package last updated on 25 May 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc