Socket
Socket
Sign inDemoInstall

node-trello

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-trello

Node wrapper for Trello's HTTP API.


Version published
Weekly downloads
1.9K
decreased by-20.69%
Maintainers
1
Weekly downloads
 
Created
Source

Node wrapper for Trello’s HTTP API.

Build Status

View Trello’s API documentation online.

Install

npm install node-trello

Getting your key and token

  • Generate your developer key and supply it as the first constructor parameter.
  • To read a user’s private information, get a token by directing them to https://trello.com/1/connect?key=<PUBLIC_KEY>&name=MyApp&response_type=token replacing, of course, <PUBLIC_KEY> with the public key obtained in the first step.
  • If you never want the token to expire, include &expiration=never in the url from the previous step.
  • If you need write access as well as read, &scope=read,write to the request for your user token.

Example Code

Fetching card data

var Trello = require("node-trello");
var t = new Trello("<your key>", "<token>");

t.get("/1/members/me", function(err, data) {
  if (err) throw err;
  console.log(data);
});

// URL arguments are passed in as an object.
t.get("/1/members/me", { cards: "open" }, function(err, data) {
  if (err) throw err;
  console.log(data);
});

Uploading attachments to a card

var fs = require("fs");
var path = require("path");
var Trello = require("node-trello");
var t = new Trello("<your key>", "<token>");

var cardId = "<the card id>";
var pathToFile = path.resolve(__dirname, "/path/to/file.doc");

t.post("/1/cards/" + cardId + "/attachments", { attachment: fs.createReadStream(pathToFile) }, function (err, attachments) {
  if (err) throw err;
  console.log(attachments);
})

License

Released under MIT.

Keywords

FAQs

Package last updated on 22 Aug 2017

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