AffixIO's picture
Upload folder using huggingface_hub
44f0c63 verified

Usage Examples

This directory contains example code demonstrating how to use the Audit Proof Circuit with the AffixIO SDK.

Prerequisites

Before running any examples, install the required dependencies:

npm install @affixio/sdk typescript @types/node ts-node

Examples

1. Basic Usage (basic-usage.ts)

Demonstrates basic usage with sandbox mode (no API key required for testing).

npx ts-node examples/basic-usage.ts

Note: Sandbox mode is for testing only. Production requires an API key.

2. Authenticated Usage (authenticated-usage.ts)

Demonstrates production usage with API key authentication.

⚠️ Requires API Key: Get your API key at https://dashboard.affix-io.com

# Set your API key as environment variable
export AFFIXIO_API_KEY=affix_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Run the example
npx ts-node examples/authenticated-usage.ts

Or set it inline:

AFFIXIO_API_KEY=affix_xxxxx npx ts-node examples/authenticated-usage.ts

3. Batch Audit (batch-audit.ts)

Demonstrates generating multiple audit proofs in batch for compliance reporting.

npx ts-node examples/batch-audit.ts

Getting an API Key

  1. Visit https://dashboard.affix-io.com
  2. Sign up or log in
  3. Navigate to "API Keys" section
  4. Create a new API key
  5. Copy and store securely

Security Best Practices

  • ✅ Always use environment variables for API keys
  • ✅ Never commit API keys to version control
  • ✅ Use sandbox mode only for testing
  • ✅ Use authenticated mode for production

More Information