1.2.16 • Published 3 years ago

algolia-crawl v1.2.16

Weekly downloads
124
License
MIT
Repository
github
Last release
3 years ago

🕷️🔍 Algolia Crawl

Crawl your website and sync all pages to Algolia search, and auto generate sitemaps from their index.

⭐️ Features

  • Crawl your website using Puppeteer
  • Sync all pages to an Algolia search index
  • Generate sitemap.xml from the index

💻 Getting started

Install from npm:

npm install algolia-crawl

Use API for Node.js:

import { algoliaCrawl, generateSitemap } from "algolia-crawl";

await algoliaCrawl(); // Crawl all pages and sync index
await generateSitemap("sitemap.xml"); // Generate a sitemap.xml file

CLI usage:

npx algolia-crawl crawl # Crawl all pages and sync index
npx algolia-crawl sitemap sitemap.xml # Generate a sitemap.xml file

Configuration

You can either create a .algoliacrawlrc.json configuration file with the following keys:

{
  "algoliaCrawlAppId": "2UFBBTMSYW",
  "algoliaCrawlIndex": "dev_KOJ",
  "algoliaCrawlStartUrl": "https://koj.co",
  "algoliaCrawlBaseUrl": "https://koj.co"
}

appId is your Algolia application ID and index is the name of the index. startUrl is the first page to crawl (it can also be an array of strings), and only pages starting with baseUrl will be indexed.

Alternately, you can provide these values as environment variables instead of the configuration file:

Environment variableDescription
ALGOLIA_CRAWL_APP_IDAlgolia search application ID
ALGOLIA_CRAWL_INDEXAlgolia search index
ALGOLIA_CRAWL_START_URLFirst page to crawl
ALGOLIA_CRAWL_BASE_URLIndex pages with this base URL

Other environment variables required are:

Environment variableDescription
ALGOLIA_CRAWL_API_KEYAlgolia search API key

📄 License

MIT © Koj

1.2.16

3 years ago

1.2.15

3 years ago

1.2.14

3 years ago

1.2.13

3 years ago

1.2.12

3 years ago

1.2.11

3 years ago

1.2.10

3 years ago

1.2.9

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago