Article
Mon, Oct 16, 2023

Introducing pwafire - npm and cdn library

Introducing a Progressive Web Apps API of APIs

Progressive Web Apps API of APIs. New Web Capabilities as one Package.

​1. Getting started

  • Install pwafire via npm and start using
npm i pwafire --save
  • Import pwafire in your for e.g React App
import pwafire from "pwafire";
const { pwa } = pwafire;
  • Get pwafire over CDN as an E6 Module
  import pwafire from "https://unpkg.com/pwafire/esm/index.js";";
  const { pwa } = pwafire;

2. API Specification

  • For promise types, the promise value returned is an object
  // Success...
{ success : true, message: 'Copied' }
 // Fail...
{ success : false, error  : {}};
  • Do something with the promise value returned for e.g copyText;
// Copy text
const res = await pwa.copyText(text);
if (res.success) {
  console.log(res.message);
} else {
  console.log(res.error);
}

3. APIs available?

We have more than 10 modern web APIs built into pwafire. All inspired by Google's Project Fugu. Learn more about all of the available APIS on this developer guide doc.

Got any question? You wanna have a chat? Hit my inbox on twitter asap 😉

  Back./Articles