一键导入
integrate-external-api
Use when integrating third-party APIs (e.g. SMTP emails, SMS notification gateways, payment checkout gates, or OCR parsers).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when integrating third-party APIs (e.g. SMTP emails, SMS notification gateways, payment checkout gates, or OCR parsers).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when adding a brand-new CRUD resource beyond the core entity (e.g. a second model the PS requires).
Use when building or restyling any page or component.
Use when constructing forms, inputs, submit behaviors, validation displays, and feedback toast alerts.
Use when creating new Next.js route handlers using the custom helper wrapper.
Use whenever the Prisma schema changes and a migration is needed.
Use when adapting the template's placeholder Item entity to a hackathon problem statement's actual domain entity.
| name | integrate-external-api |
| description | Use when integrating third-party APIs (e.g. SMTP emails, SMS notification gateways, payment checkout gates, or OCR parsers). |
Follow these best practices to connect external software services securely and reliably:
Environment Config:
.env and .env.example.process.env.API_KEY_NAME.Abstract Service Layer (Mockable):
src/lib/services/ (e.g. mail.ts, sms.ts).export async function sendEmail(to: string, subject: string, body: string) {
if (process.env.NODE_ENV === "development") {
console.log(`[MOCK EMAIL SENT TO ${to}]: ${subject} - ${body}`);
return { success: true, messageID: "mock-12345" };
}
// Real API client integration (e.g. nodemailer or Sendgrid)
// ...
}
Client-side Fetch Handlers:
src/app/api/...), and fetch them using standard fetch functions from client components.