Socket
Book a DemoInstallSign in
Socket

node-mvc-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-mvc-api

A simple Node.js module, which provides an object oriented wrapper for the MVC-online API

1.0.7
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

node-mvc-api

A simple Node.js module, which provides an object oriented wrapper for the MVC-online API.

Installation

npm install node-mvc-api

Example

var mvcAPI = require('node-mvc-api')

var CLIENT_ID     = 'c46483cedf229acc122c09a4dd946e6e8c8d5d847d623ffe859a0f026224825c'
var CLIENT_SECRET = '7237584f67b090587bd2ebd4c7fce8cedc5c9c3efda568a028e10261d273776a'
var REDIRECT_URL  = 'urn:ietf:wg:oauth:2.0:oob'

var mvc = new mvcAPI(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL);

// Generate URL for consent page landing
var url = mvc.generateAuthUrl():
// Access url and accept with your MVC-online account to get your code and hand it below.
var code = '';

// Get the access token for given code.
mvc.getToken(code, function(error, accessToken, refreshToken, results) {
  // Save accessToken
});

// Get your user account info
mvc.verifyCredentials(accessToken, function(error, profile, response) {
  console.log(profile);
});

// Get collection of communities you're following
mvc.communities(accessToken, function(error, data, response, url) {
  console.log(data);
});

// Upload file to MVC-online
var params = {
  file: 'the raw binary content of the file'
};
mvc.upload(params, accessToken, function(error, body, response, url) {
  console.log(body);
})

FAQs

Package last updated on 27 Jan 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.