Skip to content

Commit 5030799

Browse files
chore(config): move API keys to environment variables
1 parent 9e99cb0 commit 5030799

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ REACT_APP_ACTIVITY_ID=hackrplay
1212
REACT_APP_DADJOKES_URL=https://jokeapi-v2.p.rapidapi.com/joke/
1313
REACT_APP_DADJOKES_APIKEY=your_rapidapi_key_here
1414
REACT_APP_DADJOKES_APIHOST='jokeapi-v2.p.rapidapi.com'
15+
REACT_APP_APP_EDAMAM_KEY=your_edamam_api_key
16+
REACT_APP_APP_EDAMAM_ID=your_edamam_app_id
1517

1618
# Add your API keys below:
1719
# REACT_APP_SEARCH_APIKEY=your_search_api_key

src/plays/pantry-alchemy/IngredientSearch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export default function IngredientAutocomplete({ onSubmit }) {
1010
const [loading, setLoading] = useState(false);
1111
const [recipeLoading, setRecipeLoading] = useState(false);
1212
const [recipes, setRecipes] = useState([]);
13-
const appId = '65a07d9b';
14-
const appKey = '614cce709d8bbd26d92c35013e5d7861';
13+
const appId = process.env.REACT_APP_APP_EDAMAM_ID;
14+
const appKey = process.env.REACT_APP_APP_EDAMAM_KEY;
1515

1616
async function searchRecipe(ingredientsArray) {
1717
// Join array of ingredients: ['chicken', 'garlic', 'spinach'] -> "chicken garlic spinach"

0 commit comments

Comments
 (0)