Skip to content

blru/fatsecret.js

Repository files navigation

fatsecret.js Logo

Github       Docs


Fatsecret.js is an unofficial API wrapper for the FatSecret nutrition database.

Highlights

  • ✔ Full OAuth2 support
  • ✔ Fully defined types
  • ✔ Classes & helper methods for responses
  • ✔ Automatic access token refreshing

Installation

# npm
npm install --save-dev fatsecret.js

# yarn
yarn add fatsecret.js

Basic Usage

Simple example of getting a food with id 1234 and logging it to the console.

// initialize new client
const client = new FatSecret.Client({
  credentials: {
    clientId: 'fatsecret client id',
    clientSecret: 'fatsecret client secret',
    scope: ['premier', 'barcode'], // your scopes
  },
});

// get food with id
const foundFood = await client.getFood({ foodId: '1234' });

console.log(foundFood); // Food {id: '1234'...}

📌 Only 4 food related methods currently supported.

About

An unofficial API wrapper for the FatSecret nutrition database

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published