快速入门
复制一条配置 prompt,包含安装步骤和该插件的完整 Markdown 指南。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-realtimekit`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/realtimekit/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
你可以使用我们的 AI 辅助设置来安装插件。使用以下命令将 Capgo skills 添加到你的 AI 工具中:
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下 prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-realtimekit` plugin in my project.如果你更倾向于手动设置,请运行以下命令安装插件,并参考下文针对各平台的具体说明:
bun add @capgo/capacitor-realtimekitbunx cap sync导入
“导入”章节import { CapacitorRealtimekit } from '@capgo/capacitor-realtimekit';快速入门
“快速开始”章节import { CapacitorRealtimekit } from '@capgo/capacitor-realtimekit';
await CapacitorRealtimekit.initialize();示例:startMeeting
标题为“示例:startMeeting”的部分import { CapacitorRealtimekit } from '@capgo/capacitor-realtimekit';
await CapacitorRealtimekit.startMeeting({ authToken: 'your-auth-token', enableAudio: true, enableVideo: true,});常见坑点
标题为“常见坑点”的章节- 仅需初始化一次: 在应用启动阶段运行 setup。
- 原生同步: 运行
bunx cap sync在插件升级后。 - 单一事实来源: 信任
src/definitions.ts在 GitHub 仓库中。
API 概览
“API 概览”章节initialize
“initialize” 章节在使用其他方法之前,先初始化 RealtimeKit plugin。
import { CapacitorRealtimekit } from '@capgo/capacitor-realtimekit';
await CapacitorRealtimekit.initialize();startMeeting
“startMeeting” 章节使用内置 UI 开启会议。 仅支持 Android 和 iOS。
import { CapacitorRealtimekit } from '@capgo/capacitor-realtimekit';
await CapacitorRealtimekit.startMeeting({ authToken: 'your-auth-token', enableAudio: true, enableVideo: true,});类型参考
“类型参考” 章节StartMeetingOptions
“StartMeetingOptions” 章节启动会议的配置选项。
export interface StartMeetingOptions { /** * Authentication token for the participant. * This token is required to join the Cloudflare Calls meeting. * * @since 7.0.0 */ authToken: string;
/** * Whether to join with audio enabled. * Default is true. * * @default true * @since 7.0.0 */ enableAudio?: boolean;
/** * Whether to join with video enabled. * Default is true. * * @default true * @since 7.0.0 */ enableVideo?: boolean;}唯一数据源
“唯一可信来源”章节本页面由该插件的 src/definitions.ts当上游的公共 API 发生变化时,请重新运行 sync。
继续阅读入门指南
标题为“从入门指南继续”的章节如果你正在使用 快速入门 来规划 dashboard 和 API 操作,请将其连接至 使用 @capgo/capacitor-realtimekit 若要在 @capgo/capacitor-realtimekit 中使用原生能力, API 概览 关于 API 概览中的实现细节, 简介 有关 Introduction 中的实现细节, API 密钥 有关 API Keys 中的实现细节,以及 设备 有关 Devices 中的实现细节。