Galya

Galya SDK

Browser ingest and REST client for Galya.

Galya models taste from how people actually engage with content—dwell, scroll depth, revisits, saves—not just clicks. The SDK has two jobs:

  1. Browser (@galya/sdk) — tag UI components, collect signals, send batches to your ingest worker.
  2. API (@galya/agents) — search, index, and query via the Galya API. See openapi.yaml.

Browser ingest

npm install @galya/sdk
import { GalyaSDK, galyaDefaultEventsEndpoint } from "@galya/sdk";

const galya = new GalyaSDK({
  endpoint: galyaDefaultEventsEndpoint(), // POST …/v1/events
  apiKey: process.env.GALYA_API_KEY!,
  userId: "user_123", // your stable visitor id
});

REST / agents

npm install @galya/agents
import { GalyaApiClient } from "@galya/agents";

const api = new GalyaApiClient({ apiKey: process.env.GALYA_SECRET_KEY! });
await api.search(
  { relativeToEntityId: "ent_…", inTermsOfEntityType: "content" },
  { query: "minimalist coastal interiors" },
);

On this page