Copy, run and adapt

Integration examples

These examples show the two sides of a complete OEM integration: launch the Windows bonding runtime from your application, then provision and renew customer accounts from your protected server.

Windows application side

Start bonding, wait for readiness, then publish RTMP.

The downloadable examples pass the password through stdin, drain stdout and stderr concurrently, detect a complete EVENT READY line and provide a graceful stop path.

PowerShell 7

Launch and monitor StarBonding CLI

Useful for testing the complete process contract before adding it to your application.

pwsh -File .\examples\cli\start-starbonding.ps1 `
  -Username YOUR_ACCOUNT_ID
Download PowerShell example ↓
C# / .NET 8

Embed the process lifecycle

Creates the named stop event, passes credentials through stdin and starts the publisher only once after readiness.

dotnet new console -n StarBondingLauncher
copy StarBondingLauncher.cs into Program.cs
dotnet run -- YOUR_ACCOUNT_ID
Download C# example ↓

The essential integration contract

start starbonding-cli.exe --username ACCOUNT --password-stdin
write password + newline to child stdin
read complete lines from stdout and stderr concurrently
wait until stdout begins: EVENT READY 
publish H.264/AAC FLV to rtmp://127.0.0.1:1935/live/your-key
signal --stop-event for graceful shutdown

Partner server side

Provision accounts and handle billing safely.

The PHP example keeps the API key on the server, validates HTTP and JSON results, uses integer paise, and requires an idempotency key for every account creation or renewal.

PHP 8 + cURL

Complete Partner API client

List current services, check available balance, create a customer account and renew it. Financial commands require an explicit key so the same operation can be retried safely.

php partner-api.php services
php partner-api.php balance

php partner-api.php create SERVICE_ID \
  create-customer-0001 "Customer Name" customer@example.com

php partner-api.php renew USER_ID SERVICE_ID \
  renew-customer-0001
Download PHP example ↓

One intended charge, one persistent key

Generate the key when your system creates the intended operation and store it before sending the request. If the request times out, retry the identical request with that same key.

Idempotency-Key: create-customer-0001

Using a new key means a new financial operation. Do not generate a replacement key merely because the HTTP response was lost.

Read the complete Partner API contract →