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

flexoffers-js

v1.0.11

Published

A lightweight wrapper around the Flexoffers API to make building affiliate products a breeze.

Downloads

6

Readme

FlexOffers - A Fully Typed Wrapper For Monetizing With Affiliate

npm version License

Description

Looking for a lightweight wrapper for the FlexOffers API? Here it is! Flexoffers is a great platform for monetizing huge amounts of B2C traffic but as developers, we missing the DX to build these products quickly. I built this out of neccessity so I could ship and monetize products faster, and now I'm sharing so we can all make building affiliate products waaay easier.

Use this wrapper to monetize your traffic and build out products that help make life easier for everyone.

Useful Links

Want to chat? Connect with me on Twitter Sign up to Flex Offers - Affiliate Link

Installation

Use npm to install the package:

npm install flexoffers

Usage

Firstly, you need to import the module and create an instance of the FlexOffers class.

import flexoffers from 'flexoffers'
flexoffers.init('YOUR_API_KEY')

Examples

TODO: Here are examples of how to use each function in the FlexOffers API:

getFullProducts

Returns a full list of products available from flexoffers product feed.

const getProducts = async () => {
  const products = await flexoffers.products.getFullProducts({
    manufacturer: "vans",
    page: 1,
    pageSize: 20,
  });
  console.log(products);
  return products;
};

| Function | Description | |-----------------------------------|---------------------------------------------------------------------------------------| | getDomains | Retrieves the domains registered in the FlexOffers account. | | getAdvertiserTerms | Fetches the terms of the advertisers available on the platform. | | applyToAdvertiser | Allows the client to apply to an advertiser in FlexOffers. | | getAdvertisers | Fetches a list of advertisers that match given parameters. | | createDeepLink | Generates a deep link to a specific URL in an advertiser's website. | | createAffiliateLinkFromUrl | A powerful helper that takes a url string and returns a monetizable link. | | getCategories | Fetches all categories available in the FlexOffers platform. | | getProductCount | Retrieves the number of products available based on provided parameters. | | getProducts | Fetches a list of products with minimal information (product id, name, brand). | | getFullProducts | Fetches a list of products with full information. | | getCoupons | Fetches a list of available coupons for an advertiser's products. | | getPromotionalLinks | Retrieves promotional links available for products from an advertiser. | | getPromotionsCurated | Fetches a curated list of promotions available on the platform. | | getProduct | Retrieves a full description of a product based on provided parameters. | | getPromotionTypes | Fetches all promotion types available in the FlexOffers platform. | | getProductFeeds | Retrieves download links for all the subscribed feeds. | | getPromotionTypesCountByAdvertiserId | Fetches count of promotion types available for a particular advertiser id. | | getBannerTypes | Fetches available banner types for products from advertisers. | | getSales | Fetches a list of sales completed over the specified date range. | | getPaymentSummary | Retrieves payment summary information of all invoices paid to the entire account. | | getPaymentDetails | Fetches detailed payment information by searching with the PaymentId. | | getCampaigns | Retrieves a list of all available campaigns. | | getFeaturedAdvertisers | Fetches a list of featured advertisers on the platform. | | getNewestAdvertisers | Fetches a list of the newest advertisers on the platform. | | getProductAdvertisers | Retrieves a list of advertisers for a specific product. | | getProductAdvertisers | Retrieves a list of advertisers for a specific product. |

Contributing

Contributions are welcome! Please read the contributing guide to get started.

License

This package is open source and available under the MIT License