1.0.18 • Published 5 years ago

fbtokenmagic v1.0.18

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

fbtokenmagic

fbtokenmagic is a keychain for Facebook page access tokens.

Developing Facebook integrations can be frustrating. You end up with access keys for staging & productions and it's easy to make mistakes.

With fbtokenmagic you can store all of your access keys in one file. The handy CLI will make it easy to select the right one.

The CLI is a wizard which writes an access token, page id and post id to a JSON file.

Usage

npm install fbtokenmagic -g or yarn global add fbtokenmagic to install the CLI tool.

To use in your project: npm install fbtokenmagic --save or yarn add fbtokenmagic

Configuration

The CLI tool looks for a .fb.json file in either your current working directory or your home path. I recommend putting it in your home path so it's accessible for all your projects.

The contents of this file should be:

[
  {
    "name": "Your FB app name",
    "client_id": "The client id",
    "client_secret": "The client secret",
    "appToken": "Your app token",
    "keys": [
      "Access key 1",
      "Access key 2"

  }
]

You can get your app token here.

Running

In your project directory type fbtokenmagic. A wizard will start prompting you to select your app, page and post id. After completing a file called .fbToken will be written.

You can either read this by using standard fs functions and JSON.parse or use the builtin utility method:

const fbtokenmagic = require('fbtokenmagic');

const go = async () => {
  const tokenmagic = await fbtokenmagic();
  console.log(tokenmagic);
}

go();
1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago