rw-check-compatibility
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCheck Compatibility
兼容性检查
Analyze the user's project to determine whether it is compatible with Runway's public API.
分析用户项目,判断其是否与Runway的公开API兼容。
Why This Matters
为何这很重要
Runway's public API requires server-side invocation. The API key must never be exposed in client-side code. Projects that are purely frontend (static HTML/JS, client-only SPAs without a backend) cannot safely call the API.
Runway的公开API 要求服务端调用。API密钥绝对不能暴露在客户端代码中。纯前端项目(静态HTML/JS、无后端的纯客户端SPA)无法安全调用该API。
Analysis Steps
分析步骤
Step 1: Identify the Project Type
步骤1:识别项目类型
Search the project root for these files to determine the stack:
| File | Indicates |
|---|---|
| Node.js project |
| Python project |
| Go project |
| Rust project |
| Java/Kotlin project |
| Ruby project |
| PHP project |
If none of these exist, flag the project as unknown and ask the user what language/runtime they're using.
搜索项目根目录下的以下文件,确定技术栈:
| 文件 | 代表的技术栈 |
|---|---|
| Node.js 项目 |
| Python 项目 |
| Go 项目 |
| Rust 项目 |
| Java/Kotlin 项目 |
| Ruby 项目 |
| PHP 项目 |
如果以上文件均不存在,则标记项目为未知类型,并询问用户使用的语言/运行时环境。
Step 2: Check for Server-Side Capability
步骤2:检查服务端能力
Look for indicators of a server/backend:
Node.js projects — check dependencies for:
package.json- ,
express,fastify,koa,hapi,nest→ HTTP server frameworkhono - → Next.js (has API routes — compatible)
next - → Nuxt.js (has server routes — compatible)
nuxt - → Remix (has loaders/actions — compatible)
remix - → SvelteKit (has server routes — compatible)
@sveltejs/kit - → Astro (has API endpoints if SSR enabled)
astro
Python projects — check for:
- ,
flask,django,fastapi,starlette,tornado,aiohttp→ web server frameworksanic - ,
streamlit→ can make server-side callsgradio
Red flags (frontend-only):
- with only
package.json,react,vue,svelteand NO server frameworkangular - or
vite.config.tswith no server/SSR configurationwebpack.config.js - Static site generators without server routes (e.g., plain Gatsby, plain Eleventy)
- as the only entry point with inline
index.htmltags<script>
寻找服务端/后端的相关标识:
Node.js 项目 — 检查中的依赖:
package.json- ,
express,fastify,koa,hapi,nest→ HTTP服务器框架hono - → Next.js(具备API路由 — 兼容)
next - → Nuxt.js(具备服务端路由 — 兼容)
nuxt - → Remix(具备加载器/动作 — 兼容)
remix - → SvelteKit(具备服务端路由 — 兼容)
@sveltejs/kit - → Astro(若启用SSR则具备API端点)
astro
Python 项目 — 检查是否包含:
- ,
flask,django,fastapi,starlette,tornado,aiohttp→ Web服务器框架sanic - ,
streamlit→ 可进行服务端调用gradio
红色预警(纯前端项目):
- 仅包含
package.json,react,vue,svelte,且无服务器框架依赖angular - 或
vite.config.ts无服务端/SSR配置webpack.config.js - 无服务端路由的静态站点生成器(如纯Gatsby、纯Eleventy)
- 仅以为入口点,且包含内联
index.html标签<script>
Step 3: Check for Existing Runway SDK
步骤3:检查是否已安装Runway SDK
Search for existing Runway SDK installations:
Node.js:
- Check for
package.json@runwayml/sdk - Search for or
import RunwayMLin source filesrequire('@runwayml/sdk')
Python:
- Check /
requirements.txtforpyproject.tomlrunwayml - Search for or
from runwayml import RunwayMLin source filesimport runwayml
搜索是否已安装Runway SDK:
Node.js:
- 检查中是否有
package.json@runwayml/sdk - 在源码文件中搜索或
import RunwayMLrequire('@runwayml/sdk')
Python:
- 检查/
requirements.txt中是否有pyproject.tomlrunwayml - 在源码文件中搜索或
from runwayml import RunwayMLimport runwayml
Step 4: Check Runtime Version
步骤4:检查运行时版本
Node.js: Must be version 18 or higher ()
Python: Must be version 3.8 or higher ()
node --versionpython3 --versionNode.js: 版本必须为18或更高(执行查看)
Python: 版本必须为3.8或更高(执行查看)
node --versionpython3 --versionStep 5: Check for Environment Variable Support
步骤5:检查环境变量支持
Look for file, , , or dotenv configuration:
.env.env.example.env.local- Node.js: in dependencies, or framework-native env support (Next.js, etc.)
dotenv - Python: in dependencies, or framework-native support
python-dotenv
寻找文件、、或dotenv配置:
.env.env.example.env.local- Node.js:依赖中包含,或框架原生支持环境变量(如Next.js等)
dotenv - Python:依赖中包含,或框架原生支持
python-dotenv
Report Format
报告格式
After analysis, provide a clear report:
undefined分析完成后,提供清晰的报告:
undefinedRunway API Compatibility Report
Runway API兼容性报告
Project type: [Node.js / Python / etc.]
Server-side capable: [Yes / No / Partial]
Runtime version: [version] — [Compatible / Needs upgrade]
Runway SDK installed: [Yes / No]
Environment variable support: [Yes / No / Needs setup]
项目类型: [Node.js / Python / 其他]
具备服务端能力: [是 / 否 / 部分具备]
运行时版本: [版本号] — [兼容 / 需要升级]
已安装Runway SDK: [是 / 否]
环境变量支持: [是 / 否 / 需要配置]
Verdict: [COMPATIBLE / NEEDS CHANGES / INCOMPATIBLE]
结论:[兼容 / 需要修改 / 不兼容]
[If COMPATIBLE]
Your project is ready for Runway API integration. Proceed with API key setup.
[If NEEDS CHANGES]
Your project needs the following changes:
- [List specific changes needed]
[If INCOMPATIBLE]
Your project is frontend-only and cannot safely call Runway's API. Options:
- Add a backend — Add an Express/FastAPI server or use a framework with server routes (Next.js, SvelteKit, etc.)
- Use a serverless function — Add API routes via Vercel Functions, AWS Lambda, Cloudflare Workers, etc.
- Create a separate backend — Build a thin API proxy that your frontend calls
undefined[若兼容]
您的项目已准备好集成Runway API。请继续进行API密钥配置。
[若需要修改]
您的项目需要进行以下修改:
- [列出具体需要修改的内容]
[若不兼容]
您的项目为纯前端项目,无法安全调用Runway的API。可选方案:
- 添加后端 — 添加Express/FastAPI服务器,或使用具备服务端路由的框架(如Next.js、SvelteKit等)
- 使用无服务器函数 — 通过Vercel Functions、AWS Lambda、Cloudflare Workers等添加API路由
- 创建独立后端 — 构建一个轻量API代理,供前端调用
undefinedImportant Notes
重要注意事项
- Never suggest embedding the API key in client-side code. This is a security risk.
- If the project uses Next.js, Remix, SvelteKit, Nuxt, or Astro with SSR, it IS compatible — the server-side route handlers can call the API.
- Serverless platforms (Vercel, Netlify, AWS Lambda, Cloudflare Workers) are compatible.
- Docker/containerized apps are compatible if they run a server process.
- 切勿建议将API密钥嵌入客户端代码中。这存在安全风险。
- 如果项目使用Next.js、Remix、SvelteKit、Nuxt或启用SSR的Astro,则兼容 — 服务端路由处理程序可调用API。
- 无服务器平台(Vercel、Netlify、AWS Lambda、Cloudflare Workers)均兼容。
- Docker/容器化应用若运行服务器进程,则兼容。
After Compatibility Check
兼容性检查完成后
If the project is compatible, suggest the user proceed with to configure their API credentials.
+rw-setup-api-key如果项目兼容,建议用户执行来配置API凭证。
+rw-setup-api-key