Hello!
I'm new to React and trying to build a project that interfaces with GG API; it's my first time using a 3rd party API, so I'm a little confused on a few things.
1) According to the API tutorial, it seems like I need to get an Access Token whenever I first load the app? I'm confused why it's needed or how to use it in subsequent API calls because the access token doesn't seem to show up in any of the GET examples. Would someone mind clarifying this for me?
2) Any suggestions on how to get the Access Token without putting my login information into my code? Right now, I'm following the fetch() version of the cURL example as follows:
const requestOptions = {
method: 'POST',
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
body: JSON.stringify({ auth_request: {user: {email:'xxx@xxx',
password:'xxxx'},
api_key: 'xxxxx'}})
};
This means anyone can just get my login information from the source code. Also is it advisable to make the Token inaccessible; if so, how might I do that?
I would greatly appreciate any clarification y'all have on this. It's okay if the answers aren't specifically for React, I can extrapolate!
Thank you very much in advance!
A