
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@treza/sdk
Advanced tools
Core SDK for the Treza Platform - privacy-preserving KYC verification and secure enclave management.
npm install @treza/sdk ethers
In production, use EnclaveSigner so private keys never leave the Nitro Enclave:
import { TrezaClient, TrezaKYCClient, EnclaveSigner } from '@treza/sdk';
const platform = new TrezaClient();
const signer = new EnclaveSigner(platform, {
enclaveId: process.env.TREZA_ENCLAVE_ID!,
verifyAttestation: true,
});
const client = new TrezaKYCClient({
apiUrl: 'https://api.trezalabs.com/api',
blockchain: {
rpcUrl: 'https://rpc.sepolia.org',
contractAddress: '0xB1D98F688Fac29471D91234d9f8EbB37238Df6FA',
signerProvider: signer,
},
});
// Submit proof on-chain (signed inside the enclave)
const txHash = await client.submitProofOnChain({ commitment, proof, publicInputs });
import { TrezaKYCClient } from '@treza/sdk';
const client = new TrezaKYCClient({
apiUrl: 'https://api.trezalabs.com/api',
blockchain: {
rpcUrl: 'https://rpc.sepolia.org',
contractAddress: '0xB1D98F688Fac29471D91234d9f8EbB37238Df6FA',
},
});
// Check if user is an adult
const isAdult = await client.isAdult(proofId);
// Get country
const country = await client.getCountry(proofId);
// Verify multiple requirements
const result = await client.meetsRequirements(proofId, {
mustBeAdult: true,
allowedCountries: ['US', 'CA', 'GB'],
mustHaveValidDocument: true,
});
if (result.meets) {
console.log('User meets all requirements');
}
For local dev and testing, use LocalSigner. Do not use in production.
import { TrezaKYCClient, LocalSigner } from '@treza/sdk';
const client = new TrezaKYCClient({
apiUrl: 'http://localhost:3000/api',
blockchain: {
rpcUrl: 'http://localhost:8545',
contractAddress: '0x...',
signerProvider: new LocalSigner(process.env.PRIVATE_KEY!),
},
});
import { TrezaClient } from '@treza/sdk';
const client = new TrezaClient({
baseUrl: 'https://app.trezalabs.com'
});
// Create an enclave
const enclave = await client.createEnclave({
name: 'My Secure Enclave',
description: 'Privacy-preserving computation',
region: 'us-east-1',
walletAddress: '0x...',
providerId: 'aws-nitro',
providerConfig: {
dockerImage: 'my-app:latest',
cpuCount: '2',
memoryMiB: '2048'
}
});
// Get attestation
const attestation = await client.getAttestation(enclave.id);
console.log('Trust Level:', attestation.verification.trustLevel);
console.log('PCR Measurements:', attestation.attestationDocument.pcrs);
// Verify attestation
const verification = await client.verifyAttestation(enclave.id);
console.log('Is Valid:', verification.isValid);
console.log('Compliance:', verification.complianceChecks);
KYC verification client.
| Method | Description |
|---|---|
isAdult(proofId, useBlockchain?) | Check if user is 18+ |
getCountry(proofId, useBlockchain?) | Get user's nationality |
hasValidDocument(proofId, useBlockchain?) | Check document validity |
getClaims(proofId, useBlockchain?) | Get all public claims |
meetsRequirements(proofId, requirements, useBlockchain?) | Verify multiple requirements |
hasValidKYC(userAddress) | Check on-chain KYC status |
Enclave management client.
| Method | Description |
|---|---|
getEnclaves(walletAddress) | List all enclaves |
createEnclave(request) | Create new enclave |
getAttestation(enclaveId) | Get attestation document |
verifyAttestation(enclaveId, options?) | Comprehensive verification |
pauseEnclave(enclaveId, walletAddress) | Pause enclave |
resumeEnclave(enclaveId, walletAddress) | Resume enclave |
terminateEnclave(enclaveId, walletAddress) | Terminate enclave |
getEnclaveLogs(enclaveId, logType?, limit?) | Get enclave logs |
# API Configuration
TREZA_API_URL=https://api.trezalabs.com/api
TREZA_PLATFORM_URL=https://app.trezalabs.com
# Blockchain (for KYC)
SEPOLIA_RPC_URL=https://rpc.sepolia.org
SEPOLIA_KYC_VERIFIER_ADDRESS=0xB1D98F688Fac29471D91234d9f8EbB37238Df6FA
# Enclave signing (production - recommended)
TREZA_ENCLAVE_ID=enc_...your-enclave-id
# Local dev only (do NOT use in production):
# PRIVATE_KEY=0x...
MIT
FAQs
Core TREZA SDK: secure enclaves, KYC, signing, x402 payments, and PII redaction
The npm package @treza/sdk receives a total of 24 weekly downloads. As such, @treza/sdk popularity was classified as not popular.
We found that @treza/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.