Getting StartedOfficial SDKs

Official SDKs

Do not write raw cryptographic buffers if you don't have to. Our official SDKs automatically handle AES-256-GCM encryption, IV nonce generation, and strict Auth Tag validation locally on your servers.

Node.js / TypeScript SDK

The official Node.js SDK is strictly typed and built on top of the native node:crypto module. It requires Node v20+ for optimal AES-GCM performance.

bash
1npm install @marigold/node-sdk

Basic Ingestion Example

Notice how you never have to interact with Base64 payloads or Buffer concatenation. The SDK abstracts the Zero-PII liability completely.

Node.js Integration
1import { MarigoldClient } from '@marigold/node-sdk';
2
3// Initialize the client. The Master Key NEVER leaves your server.
4const marigold = new MarigoldClient({
5 bearerToken: process.env.MARIGOLD_BEARER,
6 localMasterKey: process.env.MARIGOLD_MASTER_KEY // Must be 32 bytes
7});
8
9async function runAudit() {
10 const myDatasetIds = ["ROW_101", "ROW_102", "ROW_103"];
11
12 try {
13 // The SDK automatically encrypts the dataset, generates the Session Fingerprint,
14 // transmits the payload, and decrypts the resulting flags seamlessly.
15 const results = await marigold.anomalies.detect({
16 type: "HIGH_DENSITY",
17 identifiers: myDatasetIds
18 });
19
20 console.log(`Found ${results.anomaliesFound} anomalies.`);
21 console.log(results.flags); // Decrypted flags ready for your database
22
23 } catch (error) {
24 if (error.code === 'ERR_RATE_LIMIT_EXCEEDED') {
25 // The SDK handles exponential backoff automatically if configured
26 }
27 }
28}

.NET / C# SDK

For state agencies relying on monolithic Microsoft infrastructure, we publish a highly-optimized NuGet package utilizing System.Security.Cryptography.AesGcm.

bash
1dotnet add package Marigold.Net

Python SDK (Data Science & Pandas)

Data Scientists and Data Engineers frequently use Python to parse raw civic CSVs using Pandas or Apache Spark. Our official Python SDK natively hooks into the cryptography library for C-optimized AES-GCM encryption, ensuring massive datasets are encrypted efficiently before leaving your Jupyter notebook or ETL pipeline.

bash
1pip install marigold-sdk
Python Data Pipeline
1import marigold
2import pandas as pd
3
4# Marigold abstracts the complex AES-GCM cryptography
5client = marigold.Client(api_key="...", master_key="...")
6
7# Easily pipe your Pandas dataframes into the detection engine
8df = pd.read_csv("state_voter_roll.csv")
9results = client.detect_anomalies(df, module="HIGH_DENSITY")

Go (Golang) SDK

For modern, high-throughput civic microservices requiring massive concurrency, we provide a Go package leveraging the standard library's crypto/aes and crypto/cipher packages.

bash
1go get github.com/marigold/marigold-go

Rust SDK (Extreme Memory Safety)

For highly paranoid, mission-critical infrastructure where memory leaks or buffer overflows during encryption are absolutely unacceptable, we publish an official Rust crate utilizing the ring cryptography library. This provides unparalleled C-level performance with strict memory-safety guarantees.

bash
1cargo add marigold-rs

SOC 2 Liability Shield

By utilizing the official SDKs, you are shielded from cryptographic implementation liability during third-party SOC 2 Type II audits. The SDK binaries are open-source, deterministically compiled, and audited quarterly by external cryptographers.