
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@treza/react
Advanced tools
React components and hooks for the Treza Platform - privacy-preserving KYC verification and compliance UI.
npm install @treza/react @treza/sdk ethers react react-dom
Wrap your app with the ComplianceProvider:
import { ComplianceProvider } from '@treza/react';
function App() {
return (
<ComplianceProvider
config={{
apiUrl: 'https://api.trezalabs.com/api',
contractAddress: '0xB1D98F688Fac29471D91234d9f8EbB37238Df6FA',
}}
>
<YourApp />
</ComplianceProvider>
);
}
import { useCompliance } from '@treza/react';
function VerificationStatus() {
const {
isVerified,
isLoading,
verifyUser,
claims
} = useCompliance();
if (isLoading) return <div>Checking verification...</div>;
if (!isVerified) {
return (
<button onClick={() => verifyUser()}>
Verify Identity
</button>
);
}
return (
<div>
<p>✓ Verified</p>
<p>Country: {claims?.nationality}</p>
</div>
);
}
Display verification status:
import { KYCVerificationBadge } from '@treza/react';
function UserProfile({ address }) {
return (
<div>
<h2>User Profile</h2>
<KYCVerificationBadge
address={address}
showDetails={true}
/>
</div>
);
}
Restrict access based on compliance:
import { ComplianceGate } from '@treza/react';
function ProtectedContent() {
return (
<ComplianceGate
requirements={{
mustBeAdult: true,
allowedCountries: ['US', 'CA', 'GB'],
}}
fallback={<VerifyPrompt />}
>
<RestrictedContent />
</ComplianceGate>
);
}
| Component | Description |
|---|---|
ComplianceProvider | Context provider for compliance state |
KYCVerificationBadge | Shows verification status |
ComplianceGate | Conditionally render based on compliance |
VerifyButton | One-click verification flow |
ClaimsDisplay | Show verified claims |
| Hook | Description |
|---|---|
useCompliance | Main compliance hook |
useKYCStatus | Check KYC verification status |
useClaims | Access verified claims |
useComplianceCheck | Run compliance checks |
Handle wallet connections and signing:
import { WalletService } from '@treza/react';
const walletService = new WalletService();
// Connect wallet
const address = await walletService.connect();
// Sign message for verification
const signature = await walletService.signMessage('Verify KYC');
// Get network info
const network = await walletService.getNetwork();
Direct compliance operations:
import { ComplianceService } from '@treza/react';
const compliance = new ComplianceService({
apiUrl: 'https://api.trezalabs.com/api',
contractAddress: '0x...'
});
// Check requirements
const result = await compliance.checkRequirements(address, {
mustBeAdult: true,
allowedCountries: ['US']
});
NEXT_PUBLIC_TREZA_API_URL=https://api.trezalabs.com/api
NEXT_PUBLIC_KYC_CONTRACT_ADDRESS=0xB1D98F688Fac29471D91234d9f8EbB37238Df6FA
MIT
FAQs
React components for TREZA SDK - Privacy-first DeFi UI components
The npm package @treza/react receives a total of 3 weekly downloads. As such, @treza/react popularity was classified as not popular.
We found that @treza/react 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.

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.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.