I am getting this error while running gatsby build
success Building static HTML for pages - 0.537s - 170/170 316.73/s
[Algolia] 1 queries to index
[Algolia] Running 1 query for index my-index-name...
[Algolia] Query resulted in a total of 122 results
⠋ onPostBuild
AlgoliaSearchError: Method not allowed with this API key
I am using the gatsby-plugin-algolia
and have setup my gatsby-config.js
file as follows:
require('dotenv').config({
path: `.env.production`
});
const BlogQuery = `
{
allMarkdownRemark {
nodes {
id
excerpt
frontmatter {
description
tags
title
}
internal {
content
}
}
}
}
`
const queries = [
{
query: BlogQuery,
transformer: ({ data }) => data.allMarkdownRemark.nodes,
matchFields: ['slug', 'modified'],
}
];
<---The rest of my config that does not affect this plugin--->
{
resolve: `gatsby-plugin-algolia`,
options: {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_SEARCH_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME,
queries,
chunkSize: 1000,
},
enablePartialUpdates: true,
matchFields: ['slug', 'modified'],
},
In my .env.production
file I have the following:
ALGOLIA_APP_ID=using Application ID
ALGOLIA_SEARCH_KEY=using the Search-Only API Key
ALGOLIA_ADMIN_KEY=using the Admin API Key
ALGOLIA_INDEX_NAME=using the name of my Index found in Algolia -> Indices
All the above .env
values are gathered from my admin portal:
Any guidance or suggestions on resolving this error would be appreciated. Thank you.