Skip to content
PubIndexAPI

Indexing App Starter

The Indexing App Starter is a Next.js app that you can deploy locally, or serverless to Vercel/your choice of host.

The app is a scheduled Indexing API implementation, designed to check an RSS feed on a user configurable interval - eg once every 60 seconds. If an update is found, the API will automatically notify Google to crawl the feed.

This should be useful as a starting point for publications, or to test and debug the API functionality before getting the API set up properly using a custom implementation, Cron job, or as part of the content publishing process.

You can run the app locally, or deploy it to Vercel, Netlify, or any Node.js host.

This document will guide you through the installation process and provide an overview of the app’s functionality.

View the Indexing API Starter on Github

Prerequisites

Before you begin, you need to have the following:

  • An API key
  • pnpm, Yarn, or npm package manager installed

Local/Manual Installation

To install the Indexing App Starter, follow these steps:

  1. Clone the repository:
git clone https://github.com/PubIndexingAPI/indexing-app-starter.git
  1. Navigate to the project directory:
cd indexing-app-starter
  1. Install dependencies using your preferred package manager:
pnpm install
yarn install
npm install
  1. Set up the environment variable:

For local development, create a .env.local file in the root directory and add:

NEXT_PUBLIC_API_KEY=YOUR-API-KEY

Replace ‘YOUR-API-KEY’ with your actual API key.

On the server or live environment, add the NEXT_PUBLIC_API_KEY environment variable with the value as your API key.

  1. Start the app using your preferred package manager:
pnpm dev
yarn dev
npm run dev

Install on Vercel

To install the Indexing App Starter on Vercel, follow these steps:

  1. Click the “Deploy with Vercel” button below:

Deploy with Vercel

  1. Follow the Vercel deployment process. Vercel will prompt you to add the environment variable NEXT_PUBLIC_API_KEY, which you should populate with your API key.

Install on Netlify

  1. Click the “Deploy to Netlify” button below:

Deploy to Netlify

  1. If you haven’t already, sign in or sign up for a Netlify account.
  2. Grant Netlify access to your GitHub account if prompted.
  3. On the ‘Create a new site’ page, click ‘Save & Deploy’.
  4. Go to your newly created site’s settings page by clicking on ‘Site settings’.
  5. In the ‘Build & Deploy’ section, click ‘Environment’.
  6. Add a new environment variable named NEXT_PUBLIC_API_KEY and set its value to your API key.
  7. After saving the environment variable trigger a redeploy from the ‘Deploys’ tab.

Netlify redeploy button

Without triggering a redeploy in Netlify after adding the environment variable you will get an API key error message. Please make sure to carefully follow this step and wait for the rebuild.

Functionality

The Indexing App Starter uses the Pub Index API to periodically check an RSS feed based on a user-configurable interval, e.g., every 60 seconds.

Enter an RSS feed, select an interval, then hit the ‘Start’ button.

The app will display the most recent API response, and also an updated Last Ping time.

To stop the app hit the ‘Stop’ button or close the tab.

Customization

The app as it is currently set up uses the /api/rss endpoint, but you can easily customize this or any other part of the code to your own requirements.