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

headless-trello-auth

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

headless-trello-auth

Automatically grant access for your application in Trello

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Log into a Trello account and get an authorization token for the Trello API.

Installation

Use npm: npm install headless-trello-auth

Quick Aside About NightmareJS

Nightmare is a browser automation toolkit based on Electron. Nightmare is installable and usable via NPM natively. For most cases, it will Just Work (tm) out of the box.

However, Electron requires a video buffer to be available. If you are using this library on a headless system (eg, a server with no X client, a Docker instance, or a chroot under Crouton), you will need to use a virtual framebuffer to get this library working. More information about this can be found in the Nightmare repository's issues.

Options

The exposed method takes an options hash:

  • username - the email address to log into.
  • password - the password for the account.
  • scopes - scopes to request for the logging in user. Note that anything specified here is automatically granted.
  • applicationName - the name of the application to grant access for. This can be revoked from user settings at any time.
  • noPrompts - forces an exception if 2-factor authentication is detected.

The callback (or promise resolution) passes up the newly minted token from Trello.

Usage

Callbacks

Say you wanted to add a card using the Trello API wrapper:

var headlessAuth = require('headless-trello-auth');
headlessAuth({
    username: 'user@example.com',
    password: 'MySuperSecretPassword',
    scopes: 'read,write',
    applicationName: 'headless-auth-test'
}, function(err, token){
    trello = new (require('trello'))('[application key]', token);
    trello.addCard('Clean car', 'Wax on, wax off', listId,
        function(err, trelloCard){
            if(err){
                console.log('Could not add card: ', err);
            } else {
                console.log('added card: ', trelloCard);
            }
        });
});

Promises

If you wanted to use promises instead, using the same example as above:

var headlessAuth = require('headless-trello-auth');
var promise = headlessAuth({
    username: 'user@example.com',
    password: 'MySuperSecretPassword',
    scopes: 'read,write',
    applicationName: 'headless-auth-test'
}); 

//... other code as needed ...

promise.then(function(token){
    trello = new (require('trello'))('[application key]', token);
    trello.addCard('Clean car', 'Wax on, wax off', listId,
        function(err, trelloCard){
            if(err){
                console.log('Could not add card: ', err);
            } else {
                console.log('added card: ', trelloCard);
            }
        });
});

Two-Factor Authentication

If two-factor authentication is required and detected, there will be a prompt for the SMS code unless noPrompts is specified.

Keywords

FAQs

Package last updated on 17 Dec 2015

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