open-index/open-npm huggingface dataset:
npm package: @plutoxyz/frame-js
Description: SDK for integrating with Pluto Frame
Author: Pluto
Latest version: 2.2.0

# @plutoxyz/frame-js

A comprehensive library for integrating with Pluto's privacy-preserving verification system.

## Quick Start

```bash
npm install @plutoxyz/frame-js
```

```typescript
import Pluto, { PageHooks } from "@plutoxyz/frame-js";

const hooks: PageHooks = {
  onSuccess: (proof) => console.log("Verification successful:", proof),
  onError: (error) => console.error("Verification failed:", error),
};

await Pluto.initialize(hooks);
await Pluto.connect(`
  const balance = await getAccountBalance();
  await prove('bank_balance', balance);
`);
```

## Features

- **🔌 WebSocket Client** - Real-time communication with automatic reconnection
- **🌐 API Functions** - Pre-built functions for all Pluto endpoints
- **📝 Prompt Utilities** - Validation and initialization for user prompts
- **💾 Storage Layer** - Cross-platform storage abstraction
- **🔧 HTTP Utilities** - Robust error handling for API calls

## Documentation

### Core Functionality

- **[API Reference](docs/api/README.md)** - All endpoint functions (`submitOauth`, `getProof`, etc.)
- **[WebSocket Guide](docs/websocket/README.md)** - Real-time messaging and event handling
- **[Utilities](docs/utilities/README.md)** - Prompt validation, storage, and HTTP helpers

### Examples

- **[Basic Usage](docs/examples/basic-usage.md)** - Simple integration examples
- **[Advanced WebSocket](docs/examples/advanced-websocket.md)** - Custom WebSocket integrations
- **[Custom Integration](docs/examples/custom-integration.md)** - Building custom flows

## TypeScript Support

Full TypeScript support with comprehensive type definitions:

```typescript
import {
  PromptRequest,
  SocketActionTypes,
  WebSocketClient,
} from "@plutoxyz/frame-js";
```

## React Support

For React applications, use our React wrapper:

```bash
npm install @plutoxyz/react-frame
```

React-frame re-exports all frame-js functionality with additional React hooks and components.

## License

MIT