node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


Node SDK for Pocket

This is a headless sdk for integrating with pocket app, including add new articles, modify exist articles and fetch articles, etc.


First, install the pocket sdk with npm.

npm install pocket-sdk

How to use

pocket = require('pocket-sdk')
consumer_key = 'your consumer_key'
redirect_uri = 'your redirect_uri'
pocket.init(consumer_key, redirect_uri)
# required access token
  access_token: access_token
}, (err, ret) ->
  # ret: { status: 1, complete: 1, list: {} ]
  url: '',
  title: '',
  tags: '',
  tweet_id: ''
}, (err, ret) ->
  # ret: { item: {}, status:1 }
pocket.send([actions], (err, ret) ->
  # ret: { action_results:[true], status: 1 }

Use pocket.oauth middleware

  • Supported Options
    • authorizeUri: /pocket/authorize
    • pocketCallback: /pocket/callback
    • refer: pocket
    • afterSuccess: (req, res) ->
pocket.init(consumer_key, redirect_uri)
app.configure ->
    afterSuccess: (token, req, res, next) ->
        # TODO: callback
        # token: { access_token: '', username: ''}


First, install module dependencies with npm install. If you don't have grunt-cli installed, run npm install -g grunt-cli.

Then, whenever you modified the source code in src folder, run grunt to compile before use. Or, just run grunt watch to let grunt compile the source code automatically when editing.