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

@forloopy/sendfox

v1.0.3

Published

A Node.js library for interacting with the SendFox API.

Downloads

312

Readme

@forloopy/sendfox

@forloopy/sendfox is an open-source JavaScript library, built with loose TypeScript (with plans to include comprehensive types and definitions in the future), designed for NodeJS developers to interact with the SendFox API (by Appsumo).


Features

  • Interact with the SendFox API effortlessly.
  • Built with non-strict TypeScript for ease of use and flexibility.
  • Fully supports ES Modules (ESM).
  • Open source and free for the community.

Introduction

All requests to the SendFox API require authentication. This is achieved by setting a Bearer token in the Authorization header.

To create this token, log in to your SendFox account, then go to:

https://sendfox.com/account/oauth

Locate the "Personal Access Token" table. Click "Create New Token", and follow the steps.

Alternatively, if you are building a service to allow others to interact with the SendFox API, you can authenticate users by using an OAuth Client.


Usage

To get started using this library, follow the examples below.

Import

import SendFox from '@forloopy/sendfox';

Authenticate

const sendfox = new SendFox({
    accessToken: `<ACCESS_TOKEN>`
}); 

Me

// Get info for authenticated user
const me = await sendfox.me();
console.log(me);

Lists

// Create list
const list = await sendfox.lists.create({ name: '<NAME>' });
console.log(list);

// Get list
const list = await sendfox.lists.get('<LIST_ID>');
console.log(list);

// Get all lists
const lists = await sendfox.lists.get({ page: '<PAGE_NUMBER>' });
console.log(lists);

// Get list contacts
const list = await sendfox.lists.get('<LIST_ID>');
const listContacts = await list.getContacts();
console.log(listContacts);

// Delete contact from list
const list = await sendfox.lists.get('<LIST_ID>');
const deleteContact = await list.deleteContact(<CONTACT_ID>);
console.log(deleteContact);

Contacts

// Create contact, and add to list(s)
const create = await sendfox.contacts.create({
	email: '<CONTACT_EMAIL>',
	first_name: '<CONTACT_FIRST_NAME>',
	last_name: '<CONTACT_LAST_NAME>',
	lists: ['<LIST_ID_1>','<LIST_ID_2>']
});

// Get list of unsubscribed contacts
const unsubscribed = await sendfox.contacts.unsubscribed();
console.log(unsubscribed);

Unsubscribe

// Unsubscribe contact
const unsubscribe = await sendfox.unsubscribe(<CONTACT_EMAIL>);
console.log(unsubscribe);

Campaigns

// Get campaign
const campaign = await sendfox.campaigns.get(<CAMPAIGN_ID>);
console.log(campaign);

// Get list of campaigns
const campaigns = await sendfox.campaigns.get({ page: '<PAGE_NUMBER>' });
console.log(campaigns);

Automations

// Get automation
const automation = await sendfox.automations.get(<AUTOMATION_ID>);
console.log(automation);

// Get list of automations
const automationa = await sendfox.automations.get({ page: '<PAGE_NUMBER>' });
console.log(automations);

Configuration

Coming soon...

Documentation

Coming soon...

Contributing

At this time, this project isn't accepting contributions.

License

This project is licensed under the MIT License.