Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (strapi-plugin-strapi-algolia) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Strapi plugin strapi-algolia
A strapi plugin to sync your strapi content with Algolia.
Getting started
1. Installation
With Yarn
yarn add strapi-plugin-strapi-algolia
With NPM
npm install --save strapi-plugin-strapi-algolia
2. Setup environment variables
ALGOLIA_ADMIN_KEY=your_algolia_app_id
ALGOLIA_APP_ID=your_algolia_api_key
3. Configure the plugin
In Javascript
Add the following code to ./config/plugins.js
'use strict';
module.exports = ({ env }) => ({
// ...
'strapi-algolia': {
enabled: true,
config: {
apiKey: env('ALGOLIA_ADMIN_KEY'),
applicationId: env('ALGOLIA_APP_ID'),
contentTypes: [
{ name: 'api::article.article' },
// ...
],
},
},
});
In Typescript
Add the following code to ./config/plugins.ts
export default ({ env }) => ({
// ...
'strapi-algolia': {
enabled: true,
config: {
apiKey: env('ALGOLIA_ADMIN_KEY'),
applicationId: env('ALGOLIA_APP_ID'),
contentTypes: [
{ name: 'api::article.article' },
// ...
],
},
},
});
All configurations options
Property | Description | Type | Default value |
---|---|---|---|
applicationId | Algolia application ID | string (required) | |
apiKey | Algolia API Key | string (required) | |
indexPrefix | Prefix for the Algolia index | string | `${strapi.config.environment}_` |
contentTypes | Array of content types needed to be indexed | Array<object> (required) | |
contentTypes.name | NAme of the content type | string (required) | |
contentTypes.index | Algolia index for the current content type | string | |
contentTypes.idPrefix | Prefix for the item id | string | |
contentTypes.populate | Which fields needed to be indexed on Algolia, by default all the properties are indexed | object | '*' = All fields |