Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Twitter API secret details

For the twitter api tech degree project, the twit module that is linked requires the secret information that's provided via twitter devs account.

I'm confused as to how we would write the app without exposing the details on github as I imagine most github users using teamtreehouse have a free public only account on github.

Twitter specifically says that people may be able to gain access to your account with the secret token keys etc..

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

A good option is to use an environment variable. That way during runtime, your app will have access to your api keys, but when your code is checked into github, you won't have any concern since the actual code that calls the environment variable won't mean anything to people like me, and even if I cloned your code, without that environment variable I can't do anything.