pagespeed-insights-typescript
v1.0.0
Published
Typescript library for the PageSpeed Insight API
Downloads
4
Readme
PageSpeed Insight API
Typescript library to interact with the PageSpeed Insight API.
Installation
The easiest way to install pagespeed-insights-typescript is from NPM. You can run the command below from your project directory to install the library:
npm install pagespeed-insights-typescript
Then in your code:
import PageSpeedInsights from "pagespeed-insights-typescript";
const client = new PageSpeedInsights();
Setup an API Key
const client = new PageSpeedInsights({ apiKey: "xxx" });
Getting the Insights
const client = new PageSpeedInsights();
client.run("https://example.com").then(async (res) => console.log(await res.json()));