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.
This document will guide you through the installation process and provide an overview of the app’s functionality.
Before you begin, you need to have the following:
- An API key
- pnpm, Yarn, or npm package manager installed
To install the Indexing App Starter, follow these steps:
- Clone the repository:
git clone https://github.com/PubIndexingAPI/indexing-app-starter.git
- Navigate to the project directory:
- Install dependencies using your preferred package manager:
- Set up the environment variable:
For local development, create a .env.local file in the root directory and add:
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.
- Start the app using your preferred package manager:
npm run dev
Install on Vercel
To install the Indexing App Starter on Vercel, follow these steps:
- Click the “Deploy with Vercel” button below:
- 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
- Click the “Deploy to Netlify” button below:
- If you haven’t already, sign in or sign up for a Netlify account.
- Grant Netlify access to your GitHub account if prompted.
- On the ‘Create a new site’ page, click ‘Save & Deploy’.
- Go to your newly created site’s settings page by clicking on ‘Site settings’.
- In the ‘Build & Deploy’ section, click ‘Environment’.
- Add a new environment variable named
NEXT_PUBLIC_API_KEYand set its value to your API key.
- After saving the environment variable trigger a redeploy from the ‘Deploys’ tab.
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.
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.
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.