Powerful SDKs and APIs to integrate AutoHive Protocol into your applications. Build campaigns, verify engagement, and process payments with ease.
Official SDKs for popular programming languages
# Install via npm
npm install @autohive/sdk
# Or using yarn
yarn add @autohive/sdk
Get started with AutoHive in minutes
Set up your AutoHive client with API credentials and network configuration.
View GuideReal-world implementation examples
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);
// 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);
// 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);
}
});
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.');
}
// 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);
}
Everything you need to build on AutoHive
Seamless connection with Phantom, Solflare, and other Solana wallets.
Full TypeScript support with comprehensive type definitions.
WebSocket connections for live engagement and payment events.
Comprehensive analytics for campaign performance and ROI tracking.
Join thousands of developers building on AutoHive Protocol