Code Monkey home page Code Monkey logo

sanity-page-speed-plugin's Introduction

Sanity PageSpeed Monitoring Plugin (for Sanity Studio v3)

This plugin is for Sanity Studio v3 and uses the PageSpeed Insights API to provide insights into the speed and performance of your website. To use this plugin, you will need to have an API key for the PageSpeed Insights API.

Get your credentials here

To use the PageSpeed Insights API, you will need to obtain an API key. You can get your API key by following the instructions provided in the PageSpeed API documentation.

Additionally, if you use Gmail for your Google account, you may need to generate an app password to use as your API key. Instructions for generating app passwords can be found in Google's support documentation.

Once you have obtained your API key, add it to your .env file as follows:

SANITY_STUDIO_PAGE_SPEED_INSIGHTS_API_KEY=<your API key here>

This will allow the Sanity Page Speed plugin to access the PageSpeed Insights API and provide speed and performance insights for your website.

Installation

To install this plugin, use the following command:

npm install sanity-plugin-page-speed

Usage

To use this plugin, add it as a plugin in your sanity.config.ts (or .js) file, as shown in the example below:

import {defineConfig} from 'sanity'
import {myPlugin} from 'sanity-plugin-page-speed'
//import your key from .env file
const API_KEY = `${process.env.SANITY_STUDIO_PAGE_SPEED_INSIGHTS_API_KEY}`
export default defineConfig({
  // ...
  plugins: [myPlugin({API_KEY})],
})

After adding the plugin, you can access it by opening the "Page Speed" tab in the Sanity Studio. From there, you can enter the URL of the page you want to analyze and click "Run Analysis" to get insights into the speed and performance of your website.

Acknowledgments

This plugin uses the PageSpeed Insights API by Google to provide insights into website speed and performance.

Develop & test

This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.

See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.

Supported by Halo lab

sanity-page-speed-plugin's People

Contributors

iiiymik avatar jotunn1 avatar

Stargazers

Roman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.