1.0.11 • Published 11 months ago

flexoffers-js v1.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

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;
};
FunctionDescription
getDomainsRetrieves the domains registered in the FlexOffers account.
getAdvertiserTermsFetches the terms of the advertisers available on the platform.
applyToAdvertiserAllows the client to apply to an advertiser in FlexOffers.
getAdvertisersFetches a list of advertisers that match given parameters.
createDeepLinkGenerates a deep link to a specific URL in an advertiser's website.
createAffiliateLinkFromUrlA powerful helper that takes a url string and returns a monetizable link.
getCategoriesFetches all categories available in the FlexOffers platform.
getProductCountRetrieves the number of products available based on provided parameters.
getProductsFetches a list of products with minimal information (product id, name, brand).
getFullProductsFetches a list of products with full information.
getCouponsFetches a list of available coupons for an advertiser's products.
getPromotionalLinksRetrieves promotional links available for products from an advertiser.
getPromotionsCuratedFetches a curated list of promotions available on the platform.
getProductRetrieves a full description of a product based on provided parameters.
getPromotionTypesFetches all promotion types available in the FlexOffers platform.
getProductFeedsRetrieves download links for all the subscribed feeds.
getPromotionTypesCountByAdvertiserIdFetches count of promotion types available for a particular advertiser id.
getBannerTypesFetches available banner types for products from advertisers.
getSalesFetches a list of sales completed over the specified date range.
getPaymentSummaryRetrieves payment summary information of all invoices paid to the entire account.
getPaymentDetailsFetches detailed payment information by searching with the PaymentId.
getCampaignsRetrieves a list of all available campaigns.
getFeaturedAdvertisersFetches a list of featured advertisers on the platform.
getNewestAdvertisersFetches a list of the newest advertisers on the platform.
getProductAdvertisersRetrieves a list of advertisers for a specific product.
getProductAdvertisersRetrieves 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

1.0.11

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago