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

@abdouhugo/autoresponders

v1.1.0

Published

# Install

Downloads

12

Readme

Autoresponders

Install

create Autoresponder instance

// npm install --save https://github.com/hugo-abdou/autoresponder

// 1, create file called autoresponder.{js,ts} on your project
// 2, and initialize  the Autoresponder instance
// 3, pass the config
const autoresponder = require("@abdouhugo/autoresponders").default;
const autoresponder = new Autoresponder({
    aweber: {
        endpoint: "https://api.aweber.com/1.0",
        oauth_endpoint: "https://auth.aweber.com",
        scopes: "account.read list.read subscriber.write",
        client_id: "your_aweber_client_id",
        client_secret: "your_aweber_client_secret",
        redirect_uri: "your_project_url/aweber",
    },
    mailchimp: {
        endpoint: "https://<dc>.api.mailchimp.com/3.0",
    },
    getresponse: {
        endpoint: "https://api.getresponse.com/v3",
    },
    sendinblue: {
        endpoint: "https://api.sendinblue.com/v3",
    },
    // this two options is required if you are using pabbly or zapier even if empty
    pabbly: {},
    zapier: {},
});

// export the instance
exports.modules = autoresponder;

Available drivers

getresponse , sendinblue , mailchimp , aweber , zapier , pabbly

Check if Autoresponder need OAuth

// import the instance from the file you create befor ( autoresponder.{js,ts} )
const autoresponder = require("autoresponder.{js,ts}");
// no params needed if you whant to check withOAuth
const driver = autoresponder.create();

if (driver.withOAuth()) {
    // OAuth logic  login or get tocken ext...
} else {
    // normal code
}

// you can change the requests timeout by calling the setTimout function on the driver before you call the apis
driver.setTimeout(500);

Getresponse And Sendinblue

// import the instance from the file you create befor ( autoresponder.{js,ts} )
const autoresponder = require("autoresponder.{js,ts}");
const driver = autoresponder.create("getresponse or sendinblue", {
    apiKey: user_key,
});

// test the api
await driver.testApi();

// get the list of categories from autoresponder
await driver.getList();

//  add subscriber to list (category)
await driver.addSubscriber(
    "list_id",
    "[email protected]",
    "user_first_name",
    "user_last_name"
);

Mailchimp

const autoresponder = require("autoresponder.{js,ts}");
const driver = autoresponder.create("mailchimp", {
    apiKey: user_key,
    datacenter: api_datacenter,
});

// test the api
await driver.testApi();

// get the list of categories from autoresponder
await driver.getList();

//  add subscriber to list (category)
await driver.addSubscriber(
    "list_id",
    "[email protected]",
    "user_first_name",
    "user_last_name"
);

Aweber

const autoresponder = require("autoresponder.{js,ts}");
const driver = autoresponder.create("aweber", {
    access_token: user_token,
    refresh_token: user_refresh_token,
    expires_in: user_expires_in,
});

// return the login url of aweber you nead to redirect the user to this url
// and you nead a webhook to catch the code from aweber when user login successfuly
await driver.getAuthorizationUrl();

//return access token from aweber its need the code from aweber webhook
//you need to save the returned data on databas
await driver.getAccessToken(code);

//test the api
await driver.testApi();

// get the list of categories from autoresponder
await driver.getList();

// add subscriber to list (category)
await driver.addSubscriber(
    "list_id",
    "[email protected]",
    "user_first_name",
    "user_last_name"
);

Zapier Pabbly

const autoresponder = require("autoresponder.{js,ts}");
const driver = autoresponder.create("zapier or pabbly", {
    url: webhook_url,
});

// send your data  to autoresponder
await driver.post(
    email:string,
    firstName:string,
    lasName:string,
);