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 🙏

© 2026 – Pkg Stats / Ryan Hefner

aweber-api-nodejs

v0.0.2

Published

This library was created to provide Oauth and API request functionality between NodeJS applications and the Aweber API.

Downloads

42

Readme

#Integrate AWeber with Your NodeJS Application

This library was created to provide Oauth and API request functionality between NodeJS applications and the Aweber API.

You'll also find a complete, working sample application running express in example.js. Install express using npm, I intentionally left it out of the project dependencies.

To run the example app:

consumer_key=YOUR_KEY consumer_secret=YOUR_SECRET node example.js

Step 1 - Create App, Get Credentials

  • Go to AWeber Labs and get a free development account.
  • Create an app, and retrieve your consumer key and consumer secret.

Step 2 - Do OAuth

I didn't find the node OAuth libraries to be useful. I only needed the request signing and parameter encoding, so I implemented just that. Here's how to perform each piece of the process.

Decide on a callback URL

This is the URL Aweber will send the user back to during each step of the process.

Getting a request token

var NodeAweber = require('aweber-api-nodejs');

var NA = new NodeAweber(CONSUMER_KEY, CONSUMER_SECRET, CALLBACK_URL);

NA.requestToken(callback);

Note that all variables for this request will be generated automatically. This will give you an oauth_token and oauth_token_secret you'll need in the next steps.

Authorizing request token

After getting the request token, authorizing it is as simple as redirecting the user to this URL:

https://auth.aweber.com/1.0/oauth/authorize?oauth_token=OAUTH_TOKEN_FROM_CALLBACK

Getting an access token

After the user enters their details, they'll be redirected to your application, this time via a GET request with the following query params:

  • oauth_verifier
  • oauth_token

Now, generate the access token:

var accessToken = NA.accessToken(oauth_token, oauth_verifier, token_secret_from_earlier, callback);

...And you'll now have an oauth_token_secret and oauth_token you can use for further requests!

Step 3 - Make API calls

var apiClient = NA.api(token, tokenSecret);

apiClient.request('get', 'accounts', {}, function(err, response){
  var accounts = response.entries;
  var listsUrl = 'accounts/'+accounts[0].id+'/lists';
  apiClient.request('get', listsUrl, {}, function(err, response){
    apiClient.request('post', listsUrl+'/'+response.entries[0].id+'/subscribers', {
      'ws.op': 'create',
      'email': '[email protected]'
    }, function(err, response){
      if(response.status == 201){
        res.send('subscriber added to list.');
      } else {
        res.send(JSON.stringify(response)); 
      }
    });
  });
});