Feature Description
Create a new Polyv live streaming channel and return the channel ID and basic information.
Parameter
| Parameter | Required | Type | Description | Default Value |
|---|---|---|---|---|
| name | Yes | string | Channel name, maximum 100 characters | - |
| scene | No | string | Live scene: topclass (large class), train (corporate training), alone (event marketing) | topclass |
| template | No | string | Live template: ppt (three-screen), alone (video only) | ppt |
Example
Example 1: Simple creation User: Help me create a live streaming channel called "Product Launch"
Example 2: Specify scene User: Create a corporate training live stream named "New Employee Onboarding Training" Parameters: name="New Employee Onboarding Training", scene="train"
Example 3: Full parameters User: Create a video-only live stream named "Annual Meeting Live" and use the video-only template Parameters: name="Annual Meeting Live", scene="alone", template="alone"
CLI Invocation
node scripts/polyv.js create-channel --name "<频道名称>" [--scene <场景>] [--template <模板>]
Output Format
Success response:
✅ 频道创建成功!
频道 ID: 3151318
用户 ID: xxx
Error response:
❌ [POLYV-CONFIG_MISSING] 缺少 appId 配置
提示:请设置 POLYV_APP_ID 环境变量,或创建配置文件 ~/.polyv-skills/config.json
Error Handling
| Error Code | Description | Solution |
|---|---|---|
| CONFIG_MISSING | Credentials not configured | Set environment variables or create a configuration file |
| API_ERROR | API call failed | Check the network and credential validity |
| NETWORK_ERROR | Network error | Check the network connection |
| 400 | Request parameter error | Check whether the request parameters are correct |
| 401 | Signature verification failed | Check whether appId and appSecret are correct |
| 403 | No permission to access | Check account permissions |
| 429 | Too many requests | Please try again later |
| 500 | Internal server error | Please try again later or contact technical support |
Network Error Types
| Error Type | Description | Solution |
|---|---|---|
| DNS resolution failed | Unable to resolve the API domain name | Check the network connection or DNS configuration |
| Connection refused | Unable to connect to the server | Unable to connect to the server, please try again later |
| Request timed out | Server response timed out | Server response timed out, please try again later |
Debug Mode
When troubleshooting is needed, you can enable Debug mode to obtain detailed debugging information:
# 启用 Debug 模式
export POLYV_DEBUG=true
node scripts/polyv.js create-channel --name "测试频道"
Debug mode outputs:
- Request URL and endpoint
- Request parameters (appSecret is automatically masked and displayed as
ab****yzformat) - API response content
- Timestamp information
Security note: In Debug mode, appSecret is masked and the full key will not be displayed in logs.
Notes
- Polyv credentials (appId and appSecret) must be configured the first time you use it
- Channel name is a required parameter
- Scenarios and templates have default values and usually do not need to be specified
- Configuration priority: CLI parameters > environment variables > configuration file
Advanced Usage
When more control is needed (such as setting the lecturer password, latency mode, number of co-streaming participants, etc.), please refer to Advanced Parameter Guide。
Common advanced scenarios:
- Low-latency live streaming:
--pureRtcEnabled Y - Custom password:
--channelPasswd "abc123456" - Number of co-streaming participants:
--linkMicLimit 8