Wire any runtime, any deployment, into your audit trail.
The Fabric supports two transports, Supabase JWT or HMAC token, and runs against either the eventparity.com SaaS collector or your own on-premise instance. Pick the row that matches your stack and copy the snippet.
@eventparity/sdk npm package yet, vendor sdk.ts directlyPrerequisites
- An active eventParity organisation, sales-provisioned. Talk to us via the contact form.
- Either a user account that’s an active member of that organisation (for the Supabase transport), or an HMAC token issued by an org admin from the Integrate panel (for any other runtime).
- Node 18+ / any modern browser / any runtime with WebCrypto + fetch for the SDK; HMAC mode also works from Python, Java, Go, curl, anything that can sign HMAC-SHA-256.
Install the SDK
The SDK is one TypeScript file. Vendor it into your repo. Once we publish to npm this becomes npm install @eventparity/sdk, but not today.
# The SDK is one TypeScript file with no dependencies beyond
# @supabase/supabase-js (only used when you choose the Supabase
# transport — the HMAC path uses the runtime's built-in fetch).
mkdir -p src/lib/eventparity
curl -L https://raw.githubusercontent.com/eventparity/dataGov/main/src/lib/eventparity/sdk.ts \
-o src/lib/eventparity/sdk.tsNon-TypeScript runtimes (Python, Java, Go) skip this step entirely. They hit the collector via raw HTTPS using the HMAC transport.
Pick the runtime that matches your stack
Browser or Node TypeScript app integrating against eventparity.com SaaS. Sign in as a member of the org, then pass the client into supabaseTransport().
// Browser/TS app on eventparity.com SaaS.
// Your client is signed in as a member of the org you're recording for.
import { createClient } from '@supabase/supabase-js';
import { govern, supabaseTransport } from './lib/eventparity/sdk';
const ep = createClient(
'https://eventparity.com',
import.meta.env.VITE_EVENTPARITY_ANON_KEY,
);
await ep.auth.signInWithPassword({
email: 'integrations@your-ministry.gov.ng',
password: process.env.EP_INTEGRATION_PASSWORD!,
});
const governed = govern(callModel, {
domainId: '550e8400-e29b-41d4-a716-446655440000',
piiFields: ['patient_name', 'phone_number'],
transport: supabaseTransport(ep),
});
await governed('Summarise visit history for patient X.');Verify the heartbeat in the Live Feed
Fire one call. In the eventParity dashboard go to /governance → Fabric → Overview. The Live Feed (right column) should surface a new row within 2 to 3 seconds. If it doesn’t, open the troubleshooting accordion below.
The collector annotates each heartbeat with auth_path = "jwt" or "hmac" so you can verify your transport is what you intended.
Troubleshooting
You passed a friendly name. Use the UUID from the Integrate panel, or run SELECT id FROM organizations WHERE name = '<your org>'; against the eventParity DB if you have direct access.
The Supabase client lost its session. Confirm supabase.auth.getSession() returns a non-null session before the wrapped function fires.
Three common causes: (1) the token was revoked; (2) the secret was copied wrong (must be 64 hex chars); (3) the timestamp drift exceeded plus-or-minus 5 minutes, sync your emitter’s clock.
Worth double-checking: the signed envelope is exactly tokenId + "." + timestamp + "." + body, with no extra whitespace.
The TS SDK caps payloads at 32 KB; the collector caps the wire body at 64 KB. If you’re hitting either limit, trim your metadata and the wrapped function’s output.
The TS SDK swallows dispatch errors so your wrapped function never breaks. Check the browser/server console for eventParity Telemetry Error. For HMAC mode in a server, check the response status from your fetch / requests call directly.