@streetmp/sdkv1.0.0 · ESM · 0 deps · Node ≥18

Build Governance into
Your App in 60 Seconds.

One npm install. Drop-in compatible with the OpenAI SDK. Every AI call automatically issues a cryptographic STP certificate, enforces PII protection, and logs to the Merkle audit trail.

$npm install @streetmp/sdk
MAS TRM BNM RMiT GDPR Art.25 HIPAA-ready SOC 2 aligned

One import. Full governance.

The only line that changes is the import.

Before — Unprotected
before.ts
// ❌ BEFORE — Raw OpenAI (unprotected)
import OpenAI from "openai";

const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const res = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [
    { role: "user", content: userInput } // ← raw PII, no audit trail,
                                         //   no compliance, no cert
  ],
});

// No trust score. No execution ID. No STP certificate.
// No proof this was governed. Just vibes.
No PII protectionNo audit trailNo complianceNo certificateNo trust score
After — StreetMP SDK
after.ts
// ✅ AFTER — StreetMP OS SDK (governed, certified, auditable)
import { StreetMPClient } from "@streetmp/sdk";

const client = new StreetMPClient({
  apiKey:    process.env.STREETMP_API_KEY,  // smp_live_...
  tenantId:  "acme-corp",
  partnerId: "fintech-partner-sg",          // optional white-label
});

const res = await client.chat.completions.create({
  model:    "gpt-4o",
  messages: [{ role: "user", content: userInput }],
  //         ↑ local PII pre-scan runs HERE before any network I/O
  //           StreetMPPiiError thrown if NRIC/CC/SSN detected
});

console.log(res.streetmp?.trust_score);   // 87.3
console.log(res.streetmp?.trust_band);    // "GOLD"
console.log(res.streetmp?.execution_id);  // "exec_a3f8c2d1e94b..."
console.log(res.streetmp?.pii_redacted);  // 2 fields masked
// Every call issues a tamper-evident STP/1.0 certificate.
// Verify at: os.streetmp.com/verify/exec_a3f8c2d1e94b...
Local PII scanMerkle auditSTP certificateTrust scoreAPAC compliant

Everything. Zero compromise.

All of StreetMP OS, packaged into a single import.

🔌

Drop-in OpenAI compatible

Same message format as openai.chat.completions.create(). Replace the import, add your API key, done.

🛡️

Local PII pre-flight

Scans for CC, SSN, NRIC/FIN, MyKad, IBAN, email before any network I/O. StreetMPPiiError lets you fix your data pipeline.

📜

STP Certificate on every call

Every completion returns res.streetmp.execution_id — a Merkle-anchored STP/1.0 certificate verifiable by any auditor.

🏷️

White-label branding

Set partnerId to put your company name on public verification pages: 'Verified by [You] via StreetMP Trust Protocol.'

⚖️

One-click APAC compliance

MAS TRM · BNM RMiT · PDPA-SG · GDPR enforced at kernel level. No configuration required beyond tenant ID.

📦

Zero dependencies

Uses native fetch (Node ≥18). No node_modules bloat. Ships as ESM. 8kB minified.

Built-in STP Certificate Verification

Every completion returns an execution_id. Verify it any time.

verify.ts
// STP Certificate verification — no account needed
const cert = await client.stp.verify("exec_a3f8c2d1e94b7056fe3a");

console.log(cert.verified);                    // true
console.log(cert.status);                      // "SECURE"
console.log(cert.certificate?.trust_band);     // "GOLD"
// ["MAS_TRM_9.2_AI_GOVERNANCE", "V74_CONSENSUS_REQUIRED"]
// "StreetMP Trust Protocol Kernel v1.0"
White-Label / ISV

Partner SDK — Embed StreetMP in Your Product

Set partnerId to white-label the entire trust protocol under your brand. Your customers see "Verified by [Your Company] via StreetMP Trust Protocol" on every certificate.

partner-integration.ts
// White-label partner SDK integration
import { StreetMPClient, StreetMPPiiError } from "@streetmp/sdk";

const client = new StreetMPClient({
  apiKey:    "smp_live_partner_key",
  tenantId:  "end-customer-tenant-id",
  partnerId: "your-partner-id",         // registers your brand
  userId:    currentUser.id,            // optional per-user correlation
});

try {
  const res = await client.chat.completions.create({
    messages: [{ role: "user", content: prompt }],
  });
  // Response headers contain:
  // x-streetmp-partner-id:   your-partner-id
  // x-streetmp-partner-name: Your Company Name
  // x-streetmp-partner-accent: #10b981
  // Public /verify page shows: "Verified by Your Company via STP"
} catch (e) {
  if (e instanceof StreetMPPiiError) {
    // ["CREDIT_CARD", "NRIC_FIN"]
    // The request never left your application layer.
  }
}

Configuration Reference

StreetMPClientOptions
interface StreetMPClientOptions {
  apiKey:        string;   // smp_live_...  — from os.streetmp.com/dashboard
  tenantId:      string;   // your org identifier
  partnerId?:    string;   // ISV white-label ID
  userId?:       string;   // end-user correlation (never stored with prompts)
  baseUrl?:      string;   // default: https://api.streetmp.com/v1/proxy
  timeoutMs?:    number;   // default: 30_000
  localPiiCheck?: boolean; // default: true — throws StreetMPPiiError on detect
}

Direct Proxy vs SDK

Feature
Direct Proxy
@streetmp/sdk
Setup time
0 min (Cloud SaaS)
2 min (npm install)
PII protection
Auto (kernel)
Local + kernel (2 layers)
STP certificate
✓ on every call
✓ on every call
White-label branding
✓ via partnerId
Per-user audit trail
Via x-streetmp-user-id header
Via userId option
Local PII pre-flight
✓ StreetMPPiiError
APAC compliance
✓ via tenant config
✓ inherited from tenant
Runtime dependencies
None (pure HTTP)
None (native fetch)
TypeScript types
Auto from response shape
First-class (full DTS)

Ready to govern your AI?

Get your StreetMP API key, run the install command, and your first STP-certified call will be live in under 60 seconds.

$npm install @streetmp/sdk
< 8kBBundle size (min)
0Runtime dependencies
100%TypeScript coverage