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-marketo

v1.0.0

Published

A node.js wrapper for the marketo API.

Downloads

100

Readme

node-marketo

A node.js library for the marketo API (further details: https://developers.marketo.com)

node-marketo exposes the following features of the marketo API to your node.js application:

Caution - some of these routes are not officially supported or listed in the api and may change

Version v3

  • user-details

Installation

Installing using npm (node package manager):

npm install node-marketo

If you don't have npm installed or don't want to use it:

cd ~/.node_libraries
git clone [email protected]:Datahero/node-marketo.git

Please note that parts of node-marketo depend on request by Mikeal Rogers. This library needs to be installed for the API to work. Additionally node-querystring is required. If you are using npm all dependencies should be automagically resolved for you.

Usage

Information on how to use the marketo APIs can be found below. Further information on the API methods available can be found at https://developer.marketo.com. You can also find further information on how to obtain an API key, and/or OAuth2 in your marketo account and much more on the marketo API pages.

marketo API

marketoAPI takes an options object, The only required option for version3 of the api is an oAuth token.

http://developer.marketo.com/docs/auth/

All API requests must be authenticated with a valid OAuth token. Tokens are tied to user accounts; if you’re just using the API for a single user or organizer, then follow ‘Personal Tokens’ if you’re using the API for many marketo users, then follow ‘OAuth Token Flow’. which you can find in your marketo Account. The second argument is an options object which can contain the following options:

required options:

  • token

available options

  • version The API version to use. Defaults to v3.
  • userAgent Custom User-Agent description to use in the request header.
  • contentType defaults to application/json and currently the api only supports json

The callback function for each API method gets two arguments, an error and results object.

The error object is null when no error occured. The results object contains all information retrieved as long as no error occurred.

Example:

var Marketo = require('node-marketo');

var client;

try {
  client = marketoAPI();
} catch (error) {
    console.log(error); // the options are missing, this function throws an error.
}
client = marketoAPI({
    username: process.env.USERNAME,
    password: process.env.PASSWORD
  });

// IF you have an oauth token, you can use that instead. 
token = 'a users marketo API token';
client = marketoAPI({token: token});


// login
// - will confirm that the username/password is correct.
// - will conrirm that the WSDL is correct. 

client.login({}, function (error, data) {
  
    if (error) {
        console.log(error.message);
    } else {
        console.log(JSON.stringify(data)); // Do something with your data!
    }
});

License

node-marketo is licensed under the MIT License. (See LICENSE)

Contributors