PHPackages                             brilliance/algolia-sync - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. brilliance/algolia-sync

ActiveCraft-plugin[API Development](/categories/api)

brilliance/algolia-sync
=======================

Syncing elements with Algolia using their API

4.1.8(2y ago)16134[2 PRs](https://github.com/brilliancenw/craft-algolia-sync/pulls)proprietaryPHP

Since Oct 27Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/brilliancenw/craft-algolia-sync)[ Packagist](https://packagist.org/packages/brilliance/algolia-sync)[ RSS](/packages/brilliance-algolia-sync/feed)WikiDiscussions v4 Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (83)Used By (0)

Algolia Sync plugin for Craft CMS
=================================

[](#algolia-sync-plugin-for-craft-cms)

Syncing elements with Algolia using their API

[![Screenshot](./docs/img/algolia-sync-banner.jpg)](./docs/img/algolia-sync-banner.jpg)

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.4.18 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require brilliancenw/craft-algolia-sync

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Algolia Sync.
4. In your .env file, load the Algolia Application ID, the Search Only API Key and the Admin API Key.
5. Select which element types should be synced with Algolia. If the default index names do not work for you, enter enter the names of the indexes you want to sync. These values can be set per environment.

Algolia Sync Information
------------------------

[](#algolia-sync-information)

When any record is added, edited or deleted, the Algolia Sync plugin will be alerted. If that element type is configured to be synced, it will package up these values and ship them off to the associated Algolia Index.

Prior to sending the data off, there is an event that is announaced - you can intercept the data and make changes to whatever is put in the Algolia index. You can add, edit or delete any of the data in that record (without actually changing the data in Craft.)

Here's an example of updating the value of the field with handle `myCustomFieldHandle`:

```
    Event::on(
        \brilliance\algoliasync\services\AlgoliaSyncService::class,
        \brilliance\algoliasync\services\AlgoliaSyncService::EVENT_BEFORE_ALGOLIA_SYNC,
        function (\brilliance\algoliasync\events\beforeAlgoliaSyncEvent $event) {
            $event->recordUpdate['attributes']['myCustomFieldHandle'] = "Updating the content of this field";

            // to prevent a record from being added, edited or deleted in Algolia
            // set the following flag.
            // $event->recordUpdate['processAlgoliaSync'] = false;

            }
    );

```

Some specific Field Types
-------------------------

[](#some-specific-field-types)

### Asset Fields

[](#asset-fields)

When a record has an Asset field, if there is only one asset added, it will be a string of the URL of the asset. If there are more than one assets added to that field in that record, it will be an array of the URLs of the asset. This makes featured images very useful when configured in Algolia to be the image of the record.

### Date Fields

[](#date-fields)

For every date field, three fields are sent to Algolia.

1. The unix timestamp of the date
2. The "friendly" view of the date (in American format `m/d/Y`)
3. the unix timestamp of the midnight of the date. This is helpful for searching for ranges related to dates

### Category / User / Entry fields

[](#category--user--entry-fields)

For each of these fields, the value is sent as the title of the record as an Array. Additionally, an array of the Element IDs for each of these records is sent. For example: if the record contains a Category field with the name "Genre", and I have 3 categories selected, the data sent will be

`Genre ['title 1', 'title 2', 'title 3']`AND `GenreIds [1,2,3]`

This can be used for some very complex JS work on the display of your search results in instantsearch.

Algolia Sync Roadmap
--------------------

[](#algolia-sync-roadmap)

Some things to do, and ideas for potential features:

- Configuration to exclude specific fields from the sync (for example: in a user record, do not send their email address to Algolia)
- Support for Matrix Fields
- Support for 3rd Party Field Types (maps, tables, etc)
- Custom date format for each date field

Pull Requests, Feature Requests and Bug Reports are welcome - please submit to the Git repository:

Brought to you by Brilliance

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance53

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Recently: every ~25 days

Total

74

Last Release

116d ago

Major Versions

v3.1.14 → 4.1.52023-09-25

3.2.9-beta → 4.1.72023-12-08

4.1.8 → v5.0.14-alpha2023-12-12

3.2.14-beta → 4.5.0-beta2024-08-13

4.5.0-beta → 5.0.0-alpha2024-08-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/527b0a2c3dcdbbaa89da7351d4f6d80b9b565e8609af03b69983ece1ed0bcb31?d=identicon)[markmiddleton](/maintainers/markmiddleton)

![](https://www.gravatar.com/avatar/5302eef3ad6d620515c3c53c75df6924365db70873b839c4885dcd673415af7e?d=identicon)[moorebrett0](/maintainers/moorebrett0)

---

Top Contributors

[![markmiddleton](https://avatars.githubusercontent.com/u/2645384?v=4)](https://github.com/markmiddleton "markmiddleton (50 commits)")[![moorebrett0](https://avatars.githubusercontent.com/u/11203012?v=4)](https://github.com/moorebrett0 "moorebrett0 (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![mattbloomfield](https://avatars.githubusercontent.com/u/37582550?v=4)](https://github.com/mattbloomfield "mattbloomfield (1 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginalgolia sync

### Embed Badge

![Health badge](/badges/brilliance-algolia-sync/health.svg)

```
[![Health](https://phpackages.com/badges/brilliance-algolia-sync/health.svg)](https://phpackages.com/packages/brilliance-algolia-sync)
```

###  Alternatives

[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[craftpulse/craft-typesense

Craft Plugin that synchronises with Typesense

122.7k](/packages/craftpulse-craft-typesense)[jsmrtn/craftagram

Grab Instagram content through the Instagram API

141.3k](/packages/jsmrtn-craftagram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
