Skip to main content

JavaScript SDK

NPM Installation

npm install @zkscore/sdk

Yarn Installation

yarn add @zkscore/sdk

PNPM Installation

pnpm add @zkscore/sdk

CDN Installation

<script src="https://unpkg.com/@zkscore/sdk@latest/dist/index.js"></script>

React SDK

NPM Installation

npm install @zkscore/react-sdk

Yarn Installation

yarn add @zkscore/react-sdk

PNPM Installation

pnpm add @zkscore/react-sdk

Python SDK

PIP Installation

pip install zkscore-sdk

Poetry Installation

poetry add zkscore-sdk

Conda Installation

conda install -c conda-forge zkscore-sdk

TypeScript Support

All SDKs include full TypeScript definitions:
import { ZKScoreClient } from '@zkscore/sdk';

const client = new ZKScoreClient({
  apiKey: process.env.ZKSCORE_API_KEY
});

Environment Setup

Environment Variables

Create a .env file:
ZKSCORE_API_KEY=your_api_key_here
ZKSCORE_ENVIRONMENT=mainnet

Configuration

import { ZKScoreClient } from '@zkscore/sdk';

const client = new ZKScoreClient({
  apiKey: process.env.ZKSCORE_API_KEY,
  environment: 'mainnet', // or 'testnet'
  timeout: 10000,
  retries: 3
});

Verification

Test your installation:
import { ZKScoreClient } from '@zkscore/sdk';

const client = new ZKScoreClient({
  apiKey: 'your_api_key'
});

async function testConnection() {
  try {
    const score = await client.getScore('alice.zks');
    console.log('SDK working!', score);
  } catch (error) {
    console.error('SDK error:', error);
  }
}