Library to interact with SimpleAffiliate (Shopify plugin) APIs
- Creation of AffiliateLinks
Via NPM:
npm install simple-affiliate
const SimpleAffiliate = require('simple-affiliate');
const simpleAffiliate = new SimpleAffiliate("AUTH_TOKEN");
const jsonResult = await simpleAffiliate.createAffiliateLink();
Return the payload from the SimpleAffiliate web page.
NOTE: Will need to manually inspect jsonResult.authData.linkRows
for the affiliate link.
E.g.
const affiliateLinks = json.authData.linkRows.filter(row => row.targetPath == targetLink);