Quickstart

Pick your path

1. Install SDK

npm install @neus/sdk

2. Create a Client

Initialize the client in your app. Public verifiers do not require API keys.

import { NeusClient } from '@neus/sdk';

const client = new NeusClient();

3. Verify Something

Create a content authorship proof using ownership-basic. This prompts the user’s wallet to sign a request-bound message.

const proof = await client.verify({
  verifier: 'ownership-basic',
  content: 'Hello NEUS',
  wallet: window.ethereum,
});

const qHash = proof.qHash; // Proof ID (qHash)
  • Privacy: Default to options: { privacyLevel: 'private', publicDisplay: false } unless you explicitly need public discovery.

  • Storage: Keep storeOriginalContent: false unless you intentionally need raw content stored.

  • Proof ID: Treat qHash as an opaque identifier. Use timestamps/status fields to reason about freshness.

3b. Poll status (when verifiers run async)

Some verifiers complete instantly; others return 202 and finish asynchronously. Poll until terminal status:

4. Gate Your UI

Use the React component to show content only to verified users.

5. Server-side gating (minimal eligibility)

For backend/server checks, prefer a gate check (minimal yes/no, no full proof payloads):

Freshness note: for point-in-time verifiers (balances, ownership, risk), always enforce a recency window (since / sinceDays) for high-stakes actions, or create a fresh proof and use the final status.

What's Next?

Last updated

Was this helpful?