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

new-freshbooks

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

new-freshbooks

Node.js client for the new FreshBooks API

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

FreshBooks API Client

Node.js client for the new FreshBooks API.

  var client_id = process.env.FBOOKS_CLIENT_ID;
  var client_secret = process.env.FBOOKS_CLIENT_SECRET;
  var code = process.env.FBOOKS_CODE;

  // tokens are meant to be retrieved only once, after getting an auth code via
  // navigating to an authorize link on https://my.freshbooks.com/#/developer in a browser
  FreshBooks.getTokens(client_id, client_secret, code, function(err, access_token, refresh_token) {
    if (err) throw err;

    // once you have tokens for a user, they should be saved & re-used\
    // whenever you need to use the API on behalf of that user
    var freshbooks = new FreshBooks(access_token, refresh_token);
    freshbooks.me(function(err, me) {
      if (err) throw err;

      var business_id = me.business_ids[0];
      freshbooks.getProjects(business_id, function(err, projects) {
        if (err) throw err;

        projects.forEach(function(project) {
          console.log(project.id, project.title);
        });
      });
    });
  });

Keywords

FAQs

Package last updated on 29 Jan 2018

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