third-party-integration by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill third-party-integration使用标准化的 API 调用、错误处理、身份验证和数据转换模式,与外部服务构建稳健的集成。
最小工作示例:
const axios = require("axios");
class ThirdPartyClient {
constructor(config) {
this.apiKey = config.apiKey;
this.baseUrl = config.baseUrl;
this.timeout = config.timeout || 30000;
this.retryAttempts = config.retryAttempts || 3;
this.retryDelay = config.retryDelay || 1000;
this.client = axios.create({
baseURL: this.baseUrl,
timeout: this.timeout,
headers: {
Authorization: `Bearer ${this.apiKey}`,
"Content-Type": "application/json",
},
});
}
async request(method, endpoint, data = null, options = {}) {
let lastError;
for (let attempt = 0; attempt < this.retryAttempts; attempt++) {
try {
const response = await this.client({
// ... (完整实现请参见参考指南)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/ 目录下的详细实现:
| 指南 | 内容 |
|---|---|
| 第三方客户端包装器 | 第三方客户端包装器 |
| 支付处理器集成 (Stripe) | 支付处理器集成 (Stripe) |
| 邮件服务集成 (SendGrid) | 邮件服务集成 (SendGrid) |
| Python 第三方集成 | Python 第三方集成 |
| 数据转换 | 数据转换 |
每周安装量
104
代码仓库
GitHub 星标数
126
首次出现
2026年1月21日
安全审计
安装于
gemini-cli84
opencode84
codex80
claude-code80
cursor78
github-copilot68
Build robust integrations with external services using standardized patterns for API calls, error handling, authentication, and data transformation.
Minimal working example:
const axios = require("axios");
class ThirdPartyClient {
constructor(config) {
this.apiKey = config.apiKey;
this.baseUrl = config.baseUrl;
this.timeout = config.timeout || 30000;
this.retryAttempts = config.retryAttempts || 3;
this.retryDelay = config.retryDelay || 1000;
this.client = axios.create({
baseURL: this.baseUrl,
timeout: this.timeout,
headers: {
Authorization: `Bearer ${this.apiKey}`,
"Content-Type": "application/json",
},
});
}
async request(method, endpoint, data = null, options = {}) {
let lastError;
for (let attempt = 0; attempt < this.retryAttempts; attempt++) {
try {
const response = await this.client({
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Third-Party Client Wrapper | Third-Party Client Wrapper |
| Payment Processor Integration (Stripe) | Payment Processor Integration (Stripe) |
| Email Service Integration (SendGrid) | Email Service Integration (SendGrid) |
| Python Third-Party Integration | Python Third-Party Integration |
| Data Transformation | Data Transformation |
Weekly Installs
104
Repository
GitHub Stars
126
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli84
opencode84
codex80
claude-code80
cursor78
github-copilot68
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
155,300 周安装