| 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.6.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.
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
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: string;
brand: string;
price: number;
in_stock: boolean;
image_url: string;
rating: number;
_tags: string[];
}
(): {
{
: dbRecord.,
: dbRecord.,
: (dbRecord.).(, ),
: dbRecord.?. || ,
: dbRecord.?. || ,
: dbRecord. / ,
: dbRecord. > ,
: dbRecord.?.[]?. || ,
: dbRecord. || ,
: (dbRecord),
};
}
(): {
html?.(, ).(, ).() || ;
}
(): [] {
: [] = [];
(record.) tags.();
(record.) tags.();
(record. > ) tags.();
tags;
}