Keagan Chisnall
1 min readOct 17, 2017

--

Thanks for the article Dave Berning. REST-Firebase docs and articles don’t have much code, so good to see someone writing about it!
For everyone on this path, please note that:
- Database Secrets have been depreciated and replaced with Firebase Admin SDK (private keys)
- These sensitive private keys are not needed to access the database. If you make your databse public through rules (not recommended), you don’t need anything besides a get request.
- If you want to do it properly with axios in your app, and use the logged in (already authenticated) user credentials (along with auth rules for the database), here is a very much simplified version of mine:

firebase.auth().currentUser.getIdToken(true)
.then((idToken) => {
axios.get('https://[MYPROJECTID].firebaseio.com/accounts.json?auth='+idToken)
.then((response) => console.log(response))
})
.catch((error) => console.log('Error :: ' & error.message));

--

--

Keagan Chisnall
Keagan Chisnall

Written by Keagan Chisnall

I have a background in process engineering, management, and consulting; but my passion is making systems and processes more efficient. Visit me: chisnall.io

No responses yet