Socket
Book a DemoInstallSign in
Socket

gatsby-plugin-algolia-index

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-algolia-index

[![Build Status](https://travis-ci.org/kdichev/gatsby-plugin-algolia-index.svg?branch=master)](https://travis-ci.org/kdichev/gatsby-plugin-algolia-index)

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Gatsby plugin Algolia index

Build Status

🚧 This plugin is work in progress 🚧

Feel free to open issues for any questions or ideas

$ yarn add gatsby-plugin-algolia-index

First add credentials to a .env file, which you won't commit. If you track this in your file, and especially if the site is open source, you will leak your admin API key. This would mean anyone is able to change anything on your Algolia index.

// .env.${process.env.NODE_ENV}
ALGOLIA_APP_ID=XXX
ALGOLIA_API_KEY=XXX
require('dotenv').config({
  path: `.env.${process.env.NODE_ENV}`,
})

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-algolia-index`,
      options: {
        appId: process.env.ALGOLIA_APP_ID,
        apiKey: process.env.ALGOLIA_API_KEY,
        indexName: process.env.ALGOLIA_INDEX_NAME, // for all queries
        path: 'path/to/custom/indexing-config' // optional
        chunkSize: 10000, // default: 1000
      },
    },
  ],
}

// algolia-index-config.js
// (graphql: GraphQlClient) => Promise<[]<{indexName: string, indexData: []<any>}>>

module.exports = async (/*graphql*/) => [
  { indexName: 'index1', indexData: [{ hello: '1' }] },
  { indexName: 'index2', indexData: [{ hello: '2' }] },
]

Keywords

gatsby

FAQs

Package last updated on 22 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.