Skip to content
Feralin

Developers

Node.js: quickstart

Install and first-use steps for sending events to Feralin with Node.js. Code samples come from the SDK's own README and statuses from the capability record.

Install

@feralin/node 0.1.0 is published on npm; install it with your package manager using the command below.

npm install @feralin/node

First use

import { FeralinClient } from "@feralin/node";

const feralin = new FeralinClient({
  projectKey: process.env.FERALIN_PROJECT_KEY!, // pk_… anahtarı; kaynak koda yazmayın
  collectUrl: "https://collect.example.com",
});

// İzin kararı son kullanıcınındır; uygulamadan olay başına geçirilir.
feralin.track(
  "order_completed",
  { order_id: "ord_1", fr_click: clickId },
  { userId: "user_42", consent: { analytics: true, advertising: reklamIzni } },
);

// Kimlik yöntemleri (UTP §8.2): kimlik olay başına verilir, global özellikler istemci örneğinindir.
feralin.setUserProperties({ plan: "pro", tier: 2 }, { userId: "user_42", consent: { analytics: true } });
feralin.group("acme-team", { plan: "team" }, { userId: "user_42", consent: { analytics: true } });
feralin.setGlobalProperties({ app_release: "2026.11" });

// Yakalanan hata (`fr_error`): ham yığın izi gitmez; sınır saatte 20 olay, aynı hata için 3.
try {
  await siparisiKaydet();
} catch (error) {
  feralin.captureError(error, { userId: "user_42", consent: { analytics: true } });
}

// Kapanışta kalanı gönderin.
process.once("SIGTERM", () => void feralin.close());

Code samples are taken as they are from sdks/node/README.md; comments inside may be in Turkish. You create the project key in the dashboard.

Capabilities

Node.js capability status
CapabilityStatus
Event sendingSupported
Batch sendingPartial
Consent handlingSupported
IdentitySupported
AttributionNot applicable
Deep linksNot applicable
RevenuePartial
Error capturePartial
Session replayNot applicable
TracingPlanned

Verification chain

Node.js verification chain
LinkStatus
SourcePassed
BuildPassed
TestPassed
Registry publicationPassed
Clean installPassed
Event receiptPassed
DocumentationPassed
Super Admin proofNot started

Passed means local evidence: source, build and tests ran. Registry publication and Super Admin proof are separate links; the SDK is not called ready until each has passed.