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

node-emma-sdk

v1.1.6

Published

A Node.js wrapper for Emma API

Downloads

29

Readme

Emma Logo

GurgenGri - node-emma-sdk stars - node-emma-sdk forks - node-emma-sdk License issues - node-emma-sdk

emma-sdk

Node.js wrapper for the Emma API.

Usage

var Emma = require('emma-sdk');

var emma = new Emma({
  publicKey: "your public key",
  privateKey: "private key"
});

Retrieve Subaccounts

emma.account.parent('parent_account_id').list(function (err, results) {
  // do something
}

Sample Response

{
    "subaccounts": [
        {
            "account_id": 101,
            "account_name": "Test Account Name",
            "account_status": "active"
        },
        {
            "account_id": 102,
            "account_name": "Test Account Name 2",
            "account_status": "retired"
        }
    ]
}

Retrieve Mailings

emma.mailing.subaccount('subaccount_id').list({}, function (err, results) {
  // do something
}

Sample Response

[
  {
    "mailing_type": "m",
    "send_started": null,
    "cancel_by_user_id": null,
    "mailing_id": 201,
    "recipient_count": 0,
    "cancel_ts": null,
    "mailing_status": "p",
    "month": null,
    "failure_ts": null,
    "reply_to": null,
    "year": null,
    "datacenter": null,
    "started_or_finished": null,
    "account_id": 100,
    "disabled": false,
    "created_ts": "@D:2013-08-22T09:41:45",
    "sender": "Kevin McConnell",
    "plaintext_only": false,
    "name": "Cancellable mailing",
    "parent_mailing_id": null,
    "failure_message": null,
    "send_finished": null,
    "send_at": null,
    "signup_form_id": null,
    "subject": "Cancellable mailing",
    "purged_at": null,
    "archived_ts": null
  },
  {
    "mailing_type": "m",
    "send_started": null,
    "cancel_by_user_id": null,
    "mailing_id": 200,
    "recipient_count": 0,
    "cancel_ts": null,
    "mailing_status": "c",
    "month": null,
    "failure_ts": null,
    "reply_to": null,
    "year": null,
    "datacenter": null,
    "started_or_finished": null,
    "account_id": 100,
    "disabled": false,
    "created_ts": "@D:2013-08-22T09:41:45",
    "sender": "Kevin McConnell",
    "plaintext_only": false,
    "name": "Sample Mailing",
    "parent_mailing_id": null,
    "failure_message": null,
    "send_finished": null,
    "send_at": null,
    "signup_form_id": null,
    "subject": "Sample Mailing for [% member:first_name %] [% member:last_name %]",
    "purged_at": null,
    "archived_ts": null
  }
]

You will need to generate your own API access tokens using the settings panel within emma.

To Do

  • Enhance documentation with extra details and links to the official Emma API documentation
  • Add more tests.

Supported Methods

Accounts

  • emma.account.parent(accountId).list(callback);

Fields

  • emma.field.subaccount(id).list([params], callback);
  • emma.field.subaccount(id).create(details, callback);
  • emma.field.subaccount(id).withID(id).details([params], callback);
  • emma.field.subaccount(id).withID(id).delete(callback);
  • emma.field.subaccount(id).withID(id).clear(callback);
  • emma.field.subaccount(id).withID(id).update(details, callback);

Groups

  • emma.group.subaccount(id).list([params], callback);
  • emma.group.subaccount(id).create(details, callback);
  • emma.group.subaccount(id).withID(id).details(callback);
  • emma.group.subaccount(id).withID(id).delete(callback);
  • emma.group.subaccount(id).withID(id).members(details, callback);
  • emma.group.subaccount(id).withID(id).addMembers(details, callback);
  • emma.group.subaccount(id).withID(id).removeMembers(details, callback);
  • emma.group.subaccount(id).withID(id).emptySync(details, callback);
  • emma.group.subaccount(id).withID(id).empty(details, callback);
  • emma.group.subaccount(id).withID(id).copyAllMembersTo(groupID, callback);
  • emma.group.subaccount(id).withID(id).addMembersByStatus(details, callback);
  • emma.group.subaccount(id).withID(id).update(details, callback);

Imports

  • emma.import.subaccount(id).list(callback);
  • emma.import.subaccount(id).withID(id).details(callback);
  • emma.import.subaccount(id).withID(id).listMembers(callback);

Mailings

  • emma.mailing.subaccount(id).list([params], callback);
  • emma.mailing.subaccount(id).create(details, callback);
  • emma.mailing.subaccount(id).validate(details, callback);
  • emma.mailing.subaccount(id).withID(id).details(callback);
  • emma.mailing.subaccount(id).withID(id).resend(details, callback);
  • emma.mailing.subaccount(id).withID(id).update(details, callback);
  • emma.mailing.subaccount(id).withID(id).members(callback);
  • emma.mailing.subaccount(id).withID(id).delete(callback);
  • emma.mailing.subaccount(id).withID(id).cancel(callback);
  • emma.mailing.subaccount(id).withID(id).getMessageToMember(id).all(callback);
  • emma.mailing.subaccount(id).withID(id).getMessageToMember(id).html(callback);
  • emma.mailing.subaccount(id).withID(id).getMessageToMember(id).plaintext(callback);
  • emma.mailing.subaccount(id).withID(id).getMessageToMember(id).subject(callback);
  • emma.mailing.subaccount(id).withID(id).forwardToMembers(memberID, details, callback);
  • emma.mailing.subaccount(id).withID(id).groups(callback);
  • emma.mailing.subaccount(id).withID(id).searches(callback);
  • emma.mailing.subaccount(id).withID(id).headsup(callback);

Members

  • emma.member.subaccount(id).list([params], callback);
  • emma.member.subaccount(id).bulkAdd(details, callback);
  • emma.member.subaccount(id).addOne(details, callback);
  • emma.member.subaccount(id).signup(details, callback);
  • emma.member.subaccount(id).bulkDelete(details, callback);
  • emma.member.subaccount(id).bulkUpdatingStatus(details, callback);
  • emma.member.subaccount(id).multiRemoveFromGroups(details, callback);
  • emma.member.subaccount(id).deleteAll([params], callback);
  • emma.member.subaccount(id).withID(id).details([params], callback);
  • emma.member.subaccount(id).withID(id).update(details, callback);
  • emma.member.subaccount(id).withID(id).getOptOut(callback);
  • emma.member.subaccount(id).withID(id).getMailings(callback);
  • emma.member.subaccount(id).withID(id).delete(callback);
  • emma.member.subaccount(id).withID(id).groups.list(callback);
  • emma.member.subaccount(id).withID(id).groups.add(details, callback);
  • emma.member.subaccount(id).withID(id).groups.remove(details, callback);
  • emma.member.subaccount(id).withID(id).groups.removeAll(callback);
  • emma.member.subaccount(id).withEmail(email).details([params], callback);
  • emma.member.subaccount(id).withEmail(email).optOut(callback);
  • emma.member.subaccount(id).changeStatusFrom(fromStatus).to(toStatus, callback);
  • emma.member.subaccount(id).changeStatusFrom(fromStatus).to(toStatus).withConditions(details, callback);

Responses

  • emma.response.subaccount(id).list([params], callback);
  • emma.response.subaccount(id).fromMailingID(id).list(callback);
  • emma.response.subaccount(id).fromMailingID(id).sends(callback);
  • emma.response.subaccount(id).fromMailingID(id).inProgress(callback);
  • emma.response.subaccount(id).fromMailingID(id).deliveries(callback);
  • emma.response.subaccount(id).fromMailingID(id).opens(callback);
  • emma.response.subaccount(id).fromMailingID(id).links(callback);
  • emma.response.subaccount(id).fromMailingID(id).clicks(callback);
  • emma.response.subaccount(id).fromMailingID(id).forwards(callback);
  • emma.response.subaccount(id).fromMailingID(id).optouts(callback);
  • emma.response.subaccount(id).fromMailingID(id).signups(callback);
  • emma.response.subaccount(id).fromMailingID(id).shares(callback);
  • emma.response.subaccount(id).fromMailingID(id).customerShares(callback);
  • emma.response.subaccount(id).fromMailingID(id).customerShareClicks(callback);
  • emma.response.subaccount(id).fromMailingID(id).shareOverview(callback);
  • emma.response.subaccount(id).share(shareID).details(callback);

Searches

  • emma.search.subaccount(id).list(callback);
  • emma.search.subaccount(id).create(details, callback);
  • emma.search.subaccount(id).withID(id).details(callback);
  • emma.search.subaccount(id).withID(id).update(details, callback);
  • emma.search.subaccount(id).withID(id).members(callback);
  • emma.search.subaccount(id).withID(id).delete(callback);

Webhooks

  • emma.webhook.subaccount(id).list(callback);
  • emma.webhook.subaccount(id).events(callback);
  • emma.webhook.subaccount(id).create(details, callback);
  • emma.webhook.subaccount(id).withID(id).details(callback);
  • emma.webhook.subaccount(id).withID(id).update(details, callback);
  • emma.webhook.subaccount(id).withID(id).delete(callback);
  • emma.webhook.subaccount(id).deleteAll(callback);

Triggers

  • emma.trigger.subaccount(id).list(callback);
  • emma.trigger.subaccount(id).create(details, callback);
  • emma.trigger.subaccount(id).withID(id).details(callback);
  • emma.trigger.subaccount(id).withID(id).update(details, callback);
  • emma.trigger.subaccount(id).withID(id).delete(callback);
  • emma.trigger.subaccount(id).withID(id).mailings(callback);