Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pmpsdk

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pmpsdk

Javascript api client for the Public Media Platform

  • 0.0.1
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

PMP Javascript SDK

Build Status

A Node.JS module, providing a javascript API client for the Public Media Platform. Also includes an experimental browser-ready javascript package.

WARNING! ACHTUNG! This module is under development - it will be published to NPM once the interfaces stabilize. Until then, use at your own risk.

Installation

Install with the Node.JS package manager npm

$ npm install git://github.com/publicmediaplatform/pmp-js-sdk.git

or install via git clone:

$ git clone git://github.com/publicmediaplatform/pmp-js-sdk.git
$ cd pmp-js-sdk
$ npm install

Documentation

The PMP API Docs contain several examples of how to use the sdk. But it goes something like this...

var PmpSdk = require('pmpsdk');
var sdk = new PmpSdk({client_id: 'MYID', client_secret: 'MYSECRET', host: 'https://api.pmp.io'});

sdk.fetchDoc('04224975-e93c-4b17-9df9-96db37d318f3', (doc, resp) {
  console.log(resp.status);          // 200
  console.log(resp.success);         // true
  console.log(doc.attributes.guid);  // "04224975-e93c-4b17-9df9-96db37d318f3"
  console.log(doc.attributes.title); // "PMP Home Document"
});

More detailed docs/examples forthcoming.

Developing

This module is tested/compiled using gulp.js. Check the gulpfile.coffee for the full list of commands. But to start, you need to cp test/support/config.json.example test/support/config.json, and enter some PMP credentials to test with:

{
  "username":     "myusername",
  "password":     "test1234",
  "clientid":     "THISISABIGSTRING",
  "clientsecret": "ASECRETSTRING",
  "host":         "https://api.pmp.io"
}

Then you can use gulp to run the tests, and other tasks:

$ gulp test       # run all tests
$ gulp build      # compile coffeescript
$ gulp browserify # compile experimental browser js

PMP Proxy

If you just want to explore the PMP, you can also proxy authentication locally. Make sure you've created a config.json file with at least a clientid, clientsecret and host. And BAM! A click-through-able hypermedia API on http://localhost:8008!

$ gulp proxy

[10:44:22] Requiring external module coffee-script/register
[10:44:23] Using gulpfile ~/pmp-js-sdk/gulpfile.coffee
[10:44:23] Starting 'proxy'...
[10:44:23] Finished 'proxy' after 175 ms

 ... proxy listening on http://localhost:8008 ...

GET / -> https://api.pmp.io/
GET /docs?profile=story -> https://api.pmp.io/docs?profile=story

Issues and Contributing

Report any bugs or feature-requests via the issue tracker. Or send me a fax.

License

The pmp-js-sdk is free software, and may be redistributed under the MIT-LICENSE.

Thanks for listening!

Keywords

FAQs

Package last updated on 07 Sep 2014

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