Skip to content

Walkthrough

Maclyn Brandwein edited this page Apr 21, 2016 · 5 revisions

Writing a script using this module is a pretty straightforward process. Keep in mind the requirements and limitations, but if you're looking to do some simple scripting, you should be in for a pretty easy ride.

To get started, you're going to need credentials for the Pavlok API. You need to get started at the Pavlok website by creating an account or signing in.

The next step is to go here, click 'New Application', and give it a name. In the field labeled Redirect URI, set the first line to "urn:ietf:wg:oauth:2.0:oob" and the second line to 'http://localhost:3000/auth/pavlok/result' (you can also use a custom redirect URI so long as you reference its port and name in the optional options object passed to init(...) and are using the module as a server). You should be able to click on the app's name from the Application page to see its client ID and client secret (copy these down, and don't share them!).

After setting this up, you'll need to create a Node module (npm init from your terminal/command line).

Next, download the Pavlok module (npm install --save pavlok-beta-api-login).

Create a .js file (e.g. index.js), and require Pavlok (var pavlok = require('pavlok-beta-api-login');).

Now follow the sample directions in the setup in local/server mode pages, or look at what can be done with init.

Clone this wiki locally