GitHub Buy HIVE
Developer Tools

AutoHive SDK

Powerful SDKs and APIs to integrate AutoHive Protocol into your applications. Build campaigns, verify engagement, and process payments with ease.

Choose Your Language

Official SDKs for popular programming languages

JavaScript
Python
Rust
Go
Java

Installation

# Install via npm npm install @autohive/sdk # Or using yarn yarn add @autohive/sdk

Quick Start

Get started with AutoHive in minutes

Initialize Client

Set up your AutoHive client with API credentials and network configuration.

View Guide

Create Campaign

Launch engagement campaigns with custom KPIs and automated settlements.

View Guide

Verify Engagement

Validate social interactions through our decentralized oracle network.

View Guide

Code Examples

Real-world implementation examples

1. Initialize AutoHive Client
import { AutoHiveClient } from '@autohive/sdk'; // Initialize client with network configuration const client = new AutoHiveClient({ apiKey: 'your-api-key', network: 'mainnet', // or 'testnet' rpcUrl: 'https://api.mainnet-beta.solana.com' }); // Connect wallet (e.g., Phantom wallet instance) await client.connect(wallet);
2. Create Engagement Campaign
// Define campaign parameters const campaign = await client.campaigns.create({ name: 'Summer Product Launch', budget: 10000, // in HIVE tokens targets: { platform: 'twitter', minFollowers: 1000, engagementRate: 0.03, actions: ['like', 'retweet', 'comment'] }, duration: 7 * 24 * 60 * 60, // 7 days in seconds payoutPerAction: { like: 0.5, retweet: 1.0, comment: 2.0 } }); console.log('Campaign created:', campaign.id);
3. Verify & Process Payments
// Listen for engagement events stream client.oracle.onEngagement(campaign.id, async (engagement) => { // Verify engagement through oracle network const verification = await client.oracle.verify(engagement); if (verification.isValid) { // Process automatic payment via transaction submission const payment = await client.payments.process({ campaignId: campaign.id, influencerId: engagement.userId, amount: engagement.reward, proof: verification.proof }); console.log('Payment processed:', payment.txHash); } });
4. Fetch Influencer Reputation Score
import { PublicKey } from '@solana/web3.js'; // Assuming client is initialized as read-only or full access const influencerKey = new PublicKey('INFxX5sF21B9...E2y'); const reputationAccount = await client.accounts.fetchReputation(influencerKey); if (reputationAccount) { console.log(`Reputation Score: ${reputationAccount.score}`); console.log(`Verified Campaigns: ${reputationAccount.campaignCount}`); } else { console.warn('Reputation account not found for this key.'); }
5. Sign Message for Identity Verification
// This is a standard Web3 function for verification/login const message = 'Verify my identity to link social media: ' + Date.now(); const messageBytes = new TextEncoder().encode(message); try { // Requires the wallet to be connected const signedMessage = await client.wallet.signMessage(messageBytes); console.log('Signed Message for verification:', signedMessage); // Send signed message and verification key to your backend } catch (error) { console.error('Signing failed:', error); }

SDK Features

Everything you need to build on AutoHive

Wallet Integration

Seamless connection with Phantom, Solflare, and other Solana wallets.

Type Safety

Full TypeScript support with comprehensive type definitions.

Real-time Updates

WebSocket connections for live engagement and payment events.

Analytics API

Comprehensive analytics for campaign performance and ROI tracking.

Start Building Today

Join thousands of developers building on AutoHive Protocol