Skip to content

SDK Reference

Resources and integration guides for developers building on the OikosTV ecosystem.

API Overview

OikosTV provides a robust set of RESTful APIs for managing content, monetization, and rewards. All API requests require valid authentication via your OikosTV session.

Common endpoints

GET /api/v1/videos/{shortUUID}    // Fetch video details
POST /api/v1/rewards/redeem       // Redeem PeerCredits for ad-free hours
GET /api/v1/me/rewards/balance    // Check your current credit balance

Integration Guide

Using the @crewvid/outpost-sdk

The SDK simplifies interacting with the peer network. It handles chunk fetching, decryption (AES-256-GCM), and reward tracking automatically.

javascript
import { CrewOutpostClient } from '@crewvid/outpost-sdk';

const client = new CrewOutpostClient({
  apiKey: 'your_api_key',
  storageQuota: 50, // GB
});

client.on('chunkServed', (data) => {
  console.log(`Earned credits for chunk: ${data.chunkId}`);
});

Monitoring Peer Credits

Developers can monitor real-time credit balances and redemption history via the following endpoints to provide a seamless experience in their own applications.

Webhooks & Notifications

Configure webhooks to receive real-time notifications about events on your channel.

EventDescription
Upload CompletionTriggered when a video has finished transcoding and is ready for playback
New Tip ReceivedReal-time notification when a viewer sends a tip to your channel
Membership JoinedTriggered whenever a new user joins one of your membership tiers

Setting up webhooks

  1. Navigate to Studio → Settings → Webhooks
  2. Enter your endpoint URL (must be HTTPS)
  3. Select which events to subscribe to
  4. Save — you'll receive a test payload immediately

Webhook security

Each webhook payload includes a signature in the X-OikosTV-Signature header. Verify this signature before processing the payload to ensure it's from OikosTV.


Need more help?

Check out the API Overview for detailed endpoint documentation, or join our developer community on GitHub Discussions.