用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill linktree-rate-limits命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Implement user sign-up and sign-in flows with Clerk. Use when building authentication UI, customizing sign-in experience, or implementing OAuth social login. Trigger with phrases like "clerk sign-in", "clerk sign-up", "clerk login flow", "clerk OAuth", "clerk social login".
Implement session management and middleware with Clerk. Use when managing user sessions, configuring route protection, or implementing token refresh and custom JWT templates. Trigger with phrases like "clerk session", "clerk middleware", "clerk route protection", "clerk token", "clerk JWT".
Configure enterprise SSO, role-based access control, and organization management. Use when implementing SSO integration, configuring role-based permissions, or setting up organization-level controls. Trigger with phrases like "clerk SSO", "clerk RBAC", "clerk enterprise", "clerk roles", "clerk permissions", "clerk organizations".
正在显示 SKILL.md
基于 SOC 职业分类
| name | linktree-rate-limits |
| description | Rate Limits for Linktree. Trigger: "linktree rate limits". |
| allowed-tools | Read, Write, Edit |
| version | 1.7.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","linktree","social"] |
| compatibility | Designed for Claude Code |
Linktree's API enforces rate limits per OAuth token, with analytics endpoints throttled more aggressively than profile management operations. Agencies managing dozens of creator profiles need to stagger link updates and analytics pulls across accounts to avoid hitting per-token and global IP-based limits. Bulk link reordering and analytics export during campaign launches are the most common rate-limit triggers, especially when synchronizing link performance data with external dashboards on short polling intervals.
| Endpoint | Limit | Window | Scope |
|---|---|---|---|
| Profile read/update | 60 req | 1 minute | Per OAuth token |
| Link create/update/delete | 30 req | 1 minute | Per OAuth token |
| Analytics summary | 20 req | 1 minute | Per OAuth token |
| Analytics detailed (per-link) | 10 req | 1 minute | Per OAuth token |
| Webhook management | 10 req | 1 minute | Per OAuth token |
class LinktreeRateLimiter {
private tokens: number;
private lastRefill: number;
private readonly max: number;
private readonly refillRate: number;
private queue: Array<{ resolve: () => void }> = [];
constructor(maxPerMinute: number) {
this.max = maxPerMinute;
this.tokens = maxPerMinute;
this.lastRefill = Date.now();
this.refillRate = maxPerMinute / 60_000;
}
async acquire(): Promise<void> {
this.refill();
if (this.tokens >= 1) { this.tokens -= 1; return; }
return new ( ..({ resolve }));
}
() {
now = .();
. = .(., . + (now - .) * .);
. = now;
(. >= && ..) {
. -= ;
..()!.();
}
}
}
linkLimiter = ();
analyticsLimiter = ();
async function linktreeRetry<T>(
limiter: LinktreeRateLimiter, fn: () => Promise<Response>, maxRetries = 3
): Promise<T> {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
await limiter.acquire();
const res = await fn();
if (res.ok) return res.json();
if (res.status === 429) {
const retryAfter = parseInt(res.headers.get("Retry-After") || "30", 10);
const jitter = Math.random() * 2000;
await new Promise(r => setTimeout(r, retryAfter * 1000 + jitter));
continue;
}
if (res.status >= 500 && attempt < maxRetries) {
await new Promise(r => (r, .(, attempt) * ));
;
}
();
}
();
}
async function batchUpdateLinks(profileId: string, links: any[], batchSize = 5) {
const results: any[] = [];
for (let i = 0; i < links.length; i += batchSize) {
const batch = links.slice(i, i + batchSize);
const batchResults = await Promise.all(
batch.map(link => linktreeRetry(linkLimiter, () =>
fetch(`${BASE}/api/v1/profiles/${profileId}/links/${link.id}`, {
method: "PATCH", headers,
body: JSON.stringify({ title: link.title, url: link.url }),
})
))
);
results.push(...batchResults);
if (i + batchSize < links.length) await new Promise(r => setTimeout(r, 10_000));
}
return results;
}
| Issue | Cause | Fix |
|---|---|---|
| 429 on link updates | Exceeded 30 writes/min per token | Reduce batch concurrency to 3 |
| 429 on analytics | Polling per-link stats too frequently | Cache analytics, refresh every 5 min |
| 401 token expired | OAuth token TTL exceeded | Refresh token before batch operations |
| 404 on link delete | Link already removed or archived | Skip gracefully, log warning |
| IP-level 429 | Multiple tokens from same IP | Spread requests across proxy endpoints |
See linktree-performance-tuning.