Naphthalene Possum Management
    Have ideas to improve npm?Join in the discussion! »

    fetch-with-fire

    1.5.1 • Public • Published

    fetch-with-fire

    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

    1. 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.
    2. Allow you to define a base API URL used throughout all your requests
    3. Extend or modify the fetch request's init parameter
    4. Parses the body as either JSON or a string, if neither, it will throw an error and return the error back to the user.

    Dependencies

    • This package depends on the browsers' fetch method.
      • Will throw an error if loaded without that being available!

    Token verification

    For token verification on the backend, refer to this module's complimentary token verification express middleware module.

    Examples

    -- 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
    Authors:

    Install

    npm i fetch-with-fire

    DownloadsWeekly Downloads

    2

    Version

    1.5.1

    License

    MIT

    Unpacked Size

    8.85 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar