New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pa-snappa-api-client-node

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pa-snappa-api-client-node

Node.js client for the SNAPPA API by PA

  • 0.4.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Introduction

Welcome to the node.js client for the SNAPPA API by PA (Press Association).

Installation

To utilise the SNAPPA API client for node.js install the npm module.

npm install pa-snappa-api-client

Usage

After the installation of the npm package you can start making calls to the SNAPPA API. Initially you need to instantiate the client, using your API key:

const SnappaClient = require('pa-snappa-api-client');

const client = new SnappaClient({ baseUrl: 'http://snappa.api.press.net/v1-beta', apikey: '<YOUR API KEY' });

Once instantiated you can make requests against the Feeds, Assets and Tags resources provided by the SNAPPA API as follows:

Resources

Feeds

The Feeds resource provides access to feeds.

List Feeds
client
  .feeds()
  .get(function(err, res, feeds) {
    console.log(err);
    console.log(res);
    console.log(feeds);
  });
Get Feed Items
client
  .feeds()
  .id('firehose')
  .sortProperty('modified')
  .limit(50)
  .offset(1)
  .get(function(err, res, feed) {
    console.log(err);
    console.log(res);
    console.log(feed);
  });

Assets

The Assets resource provides access to assets.

List Assets
client
  .assets()
  .query('space')
  .get(function(err, res, assets) {
    console.log(err);
    console.log(res);
    console.log(assets);
  });
Get Asset
client
  .assets()
  .id('abc-123')
  .get(function(err, res, asset) {
    console.log(err);
    console.log(res);
    console.log(feed);
  });

Tags

The Tags resource provides access to tags.

List Tags
client
  .tags()
  .query('space')
  .get(function(err, res, tags) {
    console.log(err);
    console.log(res);
    console.log(tags);
  });

FAQs

Package last updated on 01 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc