Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A little problem with run example #15

Closed
bearjr opened this issue Feb 2, 2018 · 1 comment
Closed

A little problem with run example #15

bearjr opened this issue Feb 2, 2018 · 1 comment
Assignees
Labels

Comments

@bearjr
Copy link

bearjr commented Feb 2, 2018

Maybe it's stupid, but I just started with React and it will be helpful for me: where exactly I should paste my token? I try to change API_KEY but I still don't really understand error about api.json file {Cannot find module '../api.json'}, what should I do to run example?

@Polyneue
Copy link
Owner

Polyneue commented Feb 2, 2018

Hi @bearjr -- the example directory is for working within the module itself. If you are going to be using the behance-api as a dependency of your project, you should refer to the usage example in the readme https://github.com/Polyneue/behance-api#usage:

const Behance = require('behance-api'); // The Behance API module
const Be = new Behance(API_KEY); // Instantiate a connection to Behance 

// Get Projects Data
Be.projects({q: 'motorcycle'}, function (err, res, data) {
  if (err) throw err;

  // Do something with the data received from the API
  console.dir(data);
});

You'll want to swap the API_KEY with whatever your API string is from Behance.


If you just want to run the example, swap line 3 of the example file with:

const API_KEY = 'MY_API_KEY_HERE';

@Polyneue Polyneue self-assigned this Feb 2, 2018
@Polyneue Polyneue closed this as completed Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants