CourseexeDeveloper Ecosystem
Official Courseexe SDK Guides & API Reference

Courseexe Realtime SDK Documentation

Learn how to integrate Courseexe Realtime Channels into web, mobile (Flutter, iOS, Android), and backend microservices with our official libraries, direct package downloads (npm, Composer, script bundle), or raw HTTP REST APIs.

1. Connection Parameters

To connect your client or backend service to Courseexe Realtime Channels, use the parameters below along with your application credentials obtained from the Developer Dashboard:

ParameterProduction ValueDescription
hostcourseexe.comCourseexe Realtime Gateway endpoint
port443Encrypted TLS WebSocket & REST port
securetrueConnects via wss:// and https://
keyYOUR_APP_KEYPublic application identifier
secretYOUR_APP_SECRETPrivate server secret (never expose in client code)

2. Free Sandbox Limits & Quotas

100 Sockets
Concurrent active sockets. Socket #101 is rejected with error code 4004.
200,000 / day
Daily messages (Inbound + Outbound fan-out). Resets daily at 00:00 UTC.
10 KB / msg
Max payload size per individual event broadcast.

📦 Download Packages & SDK Archives

Direct & Package Managers

You can install our official SDKs through package managers (npm, Composer, pip) or download ready-to-use zip archives and standalone JavaScript files directly:

JavaScript / TypeScript SDKnpm
npm install @courseexe/realtime

Complete browser client and Node.js server trigger SDK.

PHP Server PublisherComposer
composer require courseexe/realtime

PHP library for HMAC-signed event publishing and channel inspects.

Python Server SDKpip
pip install courseexe-realtime

Python package with trigger client and canonical signature helpers.

Direct Standalone JSUMD Bundle
<script src="https://courseexe.com/realtime.js"></script>

Zero-dependency bundle for plain HTML, WordPress, PHP, or Shopify sites.

3. JavaScript & React Client SDK (`@courseexe/realtime`)

Install from npm, yarn, or pnpm:

npm install @courseexe/realtimeor yarn / pnpm

Initialize the client and bind to channel events:

import { RealtimeClient } from '@courseexe/realtime'; // 1. Initialize with your App Key const client = new RealtimeClient({ key: 'YOUR_APP_KEY', host: 'courseexe.com', port: 443, secure: true, }); // 2. Subscribe to a public or private channel const channel = client.subscribe('orders'); // 3. Listen to live events channel.on('order-created', (data) => { console.log('Realtime event received:', data); });

4. HTML & Standalone Browser Bundle

⬇️ Download realtime.js

For direct browser use without npm or build tooling, embed the standalone script tag directly:

<script src="https://courseexe.com/realtime.js"></script> <script> const client = new CourseexeRealtime.RealtimeClient({ key: 'YOUR_APP_KEY', host: 'courseexe.com', port: 443, secure: true }); const channel = client.subscribe('live-notifications'); channel.on('alert', function(data) { alert('Live notification: ' + JSON.stringify(data)); }); </script>

5. Laravel Echo Integration

Laravel Echo

Courseexe Realtime Channels is wire-compatible with Laravel Echo. Configure your `resources/js/bootstrap.js`:

import Echo from 'laravel-echo'; window.Echo = new Echo({ broadcaster: 'reverb', key: process.env.VITE_REALTIME_APP_KEY, wsHost: 'courseexe.com', wsPort: 443, wssPort: 443, forceTLS: true, enabledTransports: ['ws', 'wss'], }); // Listen to order updates in Laravel Echo window.Echo.channel('orders') .listen('.OrderShipped', (e) => { console.log('Order status updated:', e); });

6. Mobile SDKs (Flutter / iOS / Android)

Mobile Native

Connect native mobile applications with automatic reconnection, SSL/TLS security, and full presence support:

flutter pub add courseexe_realtime
import 'package:courseexe_realtime/courseexe_realtime.dart'; void main() { final client = CourseexeRealtimeClient( key: 'YOUR_APP_KEY', host: 'courseexe.com', port: 443, secure: true, ); final channel = client.subscribe('mobile-alerts'); channel.on('push_alert', (data) { print('Flutter received realtime alert: $data'); }); }

B. iOS (Swift)

SPM & CocoaPods
Swift Package Manager (Xcode → File → Add Package Dependencies):
https://github.com/projectslyai/realtime-ios.git
Or via CocoaPods (Podfile):
pod 'CourseexeRealtime', '~> 1.0'
import CourseexeRealtime let client = RealtimeClient( key: "YOUR_APP_KEY", host: "courseexe.com", port: 443, secure: true ) let channel = client.subscribe("mobile-alerts") channel.on("push_alert") { data in print("Swift received alert: \(data)") }

C. Android (Kotlin / Gradle)

JitPack v1.0.1
1. Add JitPack repository in settings.gradle.kts:
dependencyResolutionManagement { repositories { google() mavenCentral() maven { url = uri("https://jitpack.io") } } }
2. Add dependency in app/build.gradle.kts:
implementation("com.github.projectslyai:realtime-android:v1.0.1")
import com.courseexe.realtime.CourseexeRealtimeClient val client = CourseexeRealtimeClient( key = "YOUR_APP_KEY", host = "courseexe.com", port = 443, secure = true ) val channel = client.subscribe("mobile-alerts") channel.on("push_alert") { data -> println("Android received alert: $data") }

7. Node.js Server Publisher

Publish events from your backend API using `@courseexe/realtime/server`:

npm install @courseexe/realtime
const { RealtimeServer } = require('@courseexe/realtime/server'); const realtime = new RealtimeServer({ appId: 'YOUR_APP_ID', key: 'YOUR_APP_KEY', secret: 'YOUR_APP_SECRET', host: 'courseexe.com', port: 443, }); // Broadcast event to channel subscribers async function notifyUser() { await realtime.trigger('orders', 'order-created', { orderId: 1042, amount: '$99.00', status: 'PAID' }); console.log('Event published!'); } notifyUser();

8. Python Server Publisher

Trigger events from Python services using `courseexe-realtime`:

pip install courseexe-realtime
from courseexe_realtime import RealtimeServer realtime = RealtimeServer( app_id='YOUR_APP_ID', key='YOUR_APP_KEY', secret='YOUR_APP_SECRET', host='courseexe.com', port=443, secure=True ) realtime.trigger('orders', 'order-created', { 'order_id': 1042, 'status': 'confirmed' })

9. PHP Server Publisher (Composer)

Install via Composer:

composer require courseexe/realtime
<?php use Courseexe\Realtime\RealtimeServer; $realtime = new RealtimeServer([ 'app_id' => 'YOUR_APP_ID', 'key' => 'YOUR_APP_KEY', 'secret' => 'YOUR_APP_SECRET', 'host' => 'courseexe.com', 'port' => 443 ]); $result = $realtime->trigger('orders', 'order-created', [ 'order_id' => 1042, 'status' => 'processing' ]);

10. Golang Server Publisher

Install the official Go module:

go get github.com/projectslyai/realtime-go

Initialize the client and trigger events from your Go services:

package main import ( "log" realtime "github.com/projectslyai/realtime-go" ) func main() { client := realtime.NewClient(realtime.Config{ AppID: "YOUR_APP_ID", Key: "YOUR_APP_KEY", Secret: "YOUR_APP_SECRET", Host: "courseexe.com", Port: 443, Secure: true, }) // Broadcast an event to channel subscribers err := client.Trigger("orders", "order-created", map[string]interface{}{ "order_id": 1042, "amount": "$99.00", "status": "dispatched", }) if err != nil { log.Fatalf("Failed to trigger event: %v", err) } log.Println("Event dispatched successfully to Courseexe Realtime!") }

11. Channel Types & Private Channel Authentication

Public Channels (`channel-name`)

Open to anyone without authentication. Useful for announcements, live scoreboards, and public data streams.

Private Channels (`private-channel-name`)

Requires server verification. When client subscribes to a channel prefixed with `private-`, the client calls your auth endpoint (`/api/realtime/auth`) with `socket_id` and `channel_name`. Your server signs the request using your `secret` with HMAC-SHA256 and returns:

{ "auth": "YOUR_APP_KEY:HMAC_SHA256_HEX_SIGNATURE" }
Presence Channels (`presence-channel-name`)

Private channels with peer awareness. Includes member roster and automatically emits `member_added` and `member_removed` events.

12. REST Trigger API Specification

Raw HTTP / cURL

If your programming language doesn't have an official SDK, you can trigger events directly via HTTP POST requests to the Courseexe Realtime Gateway:

Endpoint:
POST https://courseexe.com/apps/{app_id}/events

A. Authentication & Signature Generation

REST requests must include query parameters signed with your application `secret` using HMAC-SHA256:

Query ParamTypeDescription
auth_keystringYour public application key
auth_timestampintegerCurrent Unix timestamp in seconds
auth_versionstringMust be "1.0"
body_md5stringMD5 hex digest of the raw JSON request body
auth_signaturestringHMAC-SHA256 hex digest of the canonical string

B. Canonical Signature Formula

canonical_string = "POST\n/apps/" + app_id + "/events\n" + "auth_key=" + key + "&auth_timestamp=" + timestamp + "&auth_version=1.0" + "&body_md5=" + md5(body) auth_signature = hmac_sha256(canonical_string, secret)

C. Example cURL Trigger Command

curl -X POST "https://courseexe.com/apps/YOUR_APP_ID/events?auth_key=YOUR_KEY&auth_timestamp=1710000000&auth_version=1.0&body_md5=MD5_HASH&auth_signature=HMAC_SIG" \ -H "Content-Type: application/json" \ -d '{ "name": "order-created", "channels": ["orders"], "data": "{\"id\": 1042, \"total\": 99.00}" }'

D. Additional REST Endpoints

POST /apps/:app_id/batch_eventsBatch event broadcasting
GET /apps/:app_id/channelsList all occupied channels
GET /apps/:app_id/channels/:nameGet subscriber count for channel
GET /apps/:app_id/channels/:name/usersList online users in presence channel

13. Realtime Engine Error Codes

CodeMeaningResolution
4001App Key Not FoundVerify your public app key in the dashboard
4004Over Connection LimitFree sandbox cap is 100 concurrent sockets
4009Auth Signature FailedVerify private channel secret on your auth server
4100Daily Quota Exceeded200k daily messages limit reached; resets 00:00 UTC