SDKs overview

Agora.io offers a suite of Software Development Kits (SDKs) designed to integrate real-time communication functionalities into various applications. These SDKs enable developers to embed features such as live video calls, interactive live streaming, and voice chat. The SDKs are categorized by platform and provide APIs for managing media streams, user connections, and channel interactions. Agora.io's approach to SDK development focuses on providing cross-platform compatibility and simplifying the integration process for developers across different environments, including mobile, web, and desktop applications Agora.io documentation overview.

The SDKs are structured to allow developers to build applications that scale from one-to-one calls to large-scale interactive broadcasts. Key features often include adaptive bitrate streaming, network quality monitoring, and support for various audio and video codecs. The design of these SDKs aims to abstract away the complexities of real-time network protocols, allowing developers to focus on application-specific logic Agora.io developer guides. Agora.io also provides specific SDKs for popular game engines and cross-platform frameworks, catering to a broad developer audience.

Official SDKs by language

Agora.io maintains official SDKs for a range of programming languages and platforms, ensuring direct support and continuous updates. These SDKs are the primary method for integrating Agora.io's real-time communication services. Each SDK is tailored to the conventions and best practices of its respective platform or language. The table below outlines the key official SDKs, their associated packages, typical installation methods, and maturity status based on Agora.io's official documentation.

Platform/Language SDK Package Installation Command (Example) Maturity
Android (Java/Kotlin) io.agora.rtc:full-sdk Add to build.gradle: implementation 'io.agora.rtc:full-sdk:4.x.x' Stable
iOS/macOS (Objective-C/Swift) AgoraRtcEngine_iOS / AgoraRtcEngine_macOS CocoaPods: pod 'AgoraRtcEngine_iOS', '~> 4.x.x' Stable
Web (JavaScript/TypeScript) agora-rtc-sdk-ng npm: npm install agora-rtc-sdk-ng Stable
Flutter (Dart) agora_rtc_engine pub.dev: flutter pub add agora_rtc_engine Stable
React Native (JavaScript/TypeScript) react-native-agora npm: npm install react-native-agora Stable
Windows (C++) Agora_RTC_SDK_for_Windows Download and integrate DLLs/libraries manually Stable
Unity (C#) Agora_Unity_SDK Import Unity package from Agora.io downloads Stable
Electron (JavaScript) agora-electron-sdk npm: npm install agora-electron-sdk Stable

Installation

The installation process for Agora.io SDKs generally follows the standard package management practices for each respective platform. For web applications, the SDK can be installed via npm or included directly via a CDN. Mobile SDKs for Android and iOS typically use Gradle and CocoaPods, respectively. Cross-platform frameworks like Flutter and React Native also utilize their native package managers.

Web (JavaScript)

To install the Agora Web SDK NG for web applications, use npm:

npm install agora-rtc-sdk-ng --save

Alternatively, you can include the SDK via a CDN in your HTML file:

<script src="https://download.agora.io/sdk/release/AgoraRTC_N.js"></script>

Refer to the Agora Web SDK installation guide for detailed instructions.

Android (Java/Kotlin)

For Android development, add the Agora RTC SDK as a dependency in your app's build.gradle file:

dependencies {
    implementation 'io.agora.rtc:full-sdk:4.x.x'
}

Ensure you replace 4.x.x with the latest stable version. Detailed steps are available in the Agora Android SDK setup documentation.

iOS (Objective-C/Swift)

For iOS projects, CocoaPods is the recommended installation method. Add the following to your Podfile:

target 'YourProjectName' do
  use_frameworks!
  pod 'AgoraRtcEngine_iOS', '~> 4.x.x'
end

Then run pod install in your terminal. Consult the Agora iOS SDK installation guide for specific versioning and integration steps.

Flutter (Dart)

To add the Agora Flutter SDK to your project, use the flutter pub add command:

flutter pub add agora_rtc_engine

This adds the dependency to your pubspec.yaml file. Further configuration may be required for platform-specific permissions, as detailed in the Agora Flutter quickstart guide.

Quickstart example

This example demonstrates how to initialize the Agora Web SDK NG and join a video channel. It covers the basic steps required to establish a real-time video connection in a web application. This snippet assumes you have an Agora App ID and a temporary token for authentication. For production environments, secure token generation on a server is recommended Agora token security documentation.

import AgoraRTC_N from "agora-rtc-sdk-ng";

const client = AgoraRTC_N.createClient({
  mode: "rtc",
  codec: "vp8"
});

const APP_ID = "YOUR_AGORA_APP_ID";
const TOKEN = "YOUR_AGORA_TEMPORARY_TOKEN"; // For testing only. Generate on server for production.
const CHANNEL_NAME = "test_channel";

let localTracks = {
  videoTrack: null,
  audioTrack: null
};
let remoteUsers = {};

async function joinChannel() {
  client.on("user-published", handleUserPublished);
  client.on("user-unpublished", handleUserUnpublished);

  await client.join(APP_ID, CHANNEL_NAME, TOKEN, null);

  localTracks.audioTrack = await AgoraRTC_N.createMicrophoneAudioTrack();
  localTracks.videoTrack = await AgoraRTC_N.createCameraVideoTrack();

  await client.publish(Object.values(localTracks));

  const localPlayerContainer = document.createElement("div");
  localPlayerContainer.id = "local-player";
  localPlayerContainer.style.width = "640px";
  localPlayerContainer.style.height = "480px";
  document.body.append(localPlayerContainer);
  localTracks.videoTrack.play(localPlayerContainer);

  console.log("publish success");
}

async function handleUserPublished(user, mediaType) {
  const uid = user.uid;
  remoteUsers[uid] = user;
  await client.subscribe(user, mediaType);

  if (mediaType === 'video') {
    const remoteVideoTrack = user.videoTrack;
    const remotePlayerContainer = document.createElement("div");
    remotePlayerContainer.id = `remote-player-${uid}`;
    remotePlayerContainer.style.width = "640px";
    remotePlayerContainer.style.height = "480px";
    document.body.append(remotePlayerContainer);
    remoteVideoTrack.play(remotePlayerContainer);
  }

  if (mediaType === 'audio') {
    const remoteAudioTrack = user.audioTrack;
    remoteAudioTrack.play();
  }
}

function handleUserUnpublished(user) {
  const uid = user.uid;
  delete remoteUsers[uid];
  document.getElementById(`remote-player-${uid}`)?.remove();
}

joinChannel();

This code snippet initializes the Agora client, joins a channel using an App ID and token, creates local audio and video tracks, publishes them, and subscribes to remote users' streams. It also includes basic event handlers for when users publish or unpublish their media. For a complete understanding and more advanced features, refer to the Agora Web SDK NG quickstart documentation.

Community libraries

While Agora.io provides a comprehensive set of official SDKs, the developer community often contributes additional libraries and wrappers that extend functionality or simplify integration with specific frameworks. These community-driven projects can offer alternative approaches or specialized tools not covered by the official offerings. For instance, developers might create custom UI components built on top of Agora's core SDKs or provide integrations for less common platforms.

One example of community involvement is the development of specific integrations for niche frameworks or older versions of platforms that might not receive the same level of direct support as the primary SDKs. These libraries are typically hosted on platforms like GitHub and can be discovered through Agora.io's developer forums or community sections Agora.io community resources. When considering community libraries, developers should evaluate their maintenance status, documentation quality, and compatibility with the official Agora.io SDK versions. Resources like MDN Web Docs on JavaScript modules can provide context on how third-party modules are typically integrated into projects, which is relevant for many community-created Agora.io wrappers.

It is important to note that community libraries are not officially supported by Agora.io, meaning that support and updates depend on the maintainers of those projects. Developers should review the source code and community feedback before incorporating them into production applications.