Fetch module that extends the browsers' fetch method to interact with backend with firebase auth tokens.
Your project is assumed to be using firebase auth as the stateless auth system.
Note that this is essentially a thin wrapper with a few added functionalities
- Automatically add Firebase auth JWT token to request header using this api
- Note that if you are not logged in to firebase auth, the token will simply be not included. It is only included if available.
- Allow you to define a base API URL used throughout all your requests
- Extend or modify the fetch request's init parameter
- Parses the body as either JSON or a string, if neither, it will throw an error and return the error back to the user.
- This package depends on the browsers' fetch method.
- Will throw an error if loaded without that being available!
For token verification on the backend, refer to this module's complimentary token verification express middleware module.
-- TODO --
License, Author and Contributing
This project is developed and made available under the "MIT License". Feel free to use it however you like!
If you have any questions, contact us via email