| name | algolia-data-handling |
| description | Implement Algolia data handling: record transforms, PII filtering before indexing,
data retention, GDPR/CCPA compliance with Algolia's deleteByQuery and Insights deletion.
Trigger: "algolia data", "algolia PII", "algolia GDPR", "algolia data retention",
"algolia privacy", "algolia CCPA", "algolia data sync".
|
| allowed-tools | Read, Write, Edit |
| version | 1.7.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","search","algolia"] |
| compatibility | Designed for Claude Code |
Algolia Data Handling
Overview
Algolia stores your records in their cloud. You control what data goes in (via saveObjects), what comes back (via attributesToRetrieve), and what users can search (via searchableAttributes). For privacy compliance, you must filter PII before indexing and implement deletion workflows.
Prerequisites
- A documented data classification for the source records and approval to index only the searchable fields.
- An Algolia Admin key held by the backend indexing job, never the browser.
- A deletion and retention owner for data-subject requests before production records are copied to Algolia.
Data Flow: Source → Algolia → User
Source Database Transform Algolia Index Search Response
┌──────────┐ ┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│ Full user │ │ Strip PII │ │ Searchable │ │ Retrieved │
│ record │ ──▶ │ Truncate │ ──▶ │ fields only │ ──▶ │ fields only │
│ (all cols)│ │ Normalize │ │ + ranking data │ │ (UI needs) │
└──────────┘ └──────────────┘ └──────────────────┘ └──────────────┘
Instructions
Examples
The transformations below demonstrate an allowlist-first record shape, explicit PII removal, deletion handling, and bounded retention. Apply the same policy to every source connector rather than relying on dashboard settings alone.
Step 1: Transform Records Before Indexing
import { algoliasearch } from 'algoliasearch';
const client = algoliasearch(process.env.ALGOLIA_APP_ID!, process.env.ALGOLIA_ADMIN_KEY!);
interface AlgoliaProduct {
objectID: string;
name: string;
description: string;
category: ;
: ;
: ;
: ;
: ;
: ;
: [];
}
(): {
{
: dbRecord.,
: dbRecord.,
: (dbRecord.).(, ),
: dbRecord.?. || ,
: dbRecord.?. || ,
: dbRecord. / ,
: dbRecord. > ,
: dbRecord.?.[]?. || ,
: dbRecord. || ,
: (dbRecord),
};
}
(): {
html?.(, ).(, ).() || ;
}
(): [] {
: [] = [];
(record.) tags.();
(record.) tags.();
(record. > ) tags.();
tags;
}