Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Nick:

Nicolas5606fe587068
diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts
index ac60dc535..151733c0b 100644
--- a/apps/api/src/controllers/auth.ts
+++ b/apps/api/src/controllers/auth.ts
@@ -222,7 +222,8 @@ export async function supaAuthenticateUser(
rateLimiter = getRateLimiter(
RateLimiterMode.Scrape,
token,
- subscriptionData.plan
+ subscriptionData.plan,
+ teamId
);
break;
case RateLimiterMode.Search:
diff --git a/apps/api/src/services/rate-limiter.ts b/apps/api/src/services/rate-limiter.ts
index cd923c4ca..d96da0695 100644
--- a/apps/api/src/services/rate-limiter.ts
+++ b/apps/api/src/services/rate-limiter.ts
@@ -84,16 +84,28 @@ export const testSuiteRateLimiter = new RateLimiterRedis({
duration: 60, // Duration in seconds
});
+export const devBRateLimiter = new RateLimiterRedis({
+ storeClient: redisRateLimitClient,
+ keyPrefix: "dev-b",
+ points: 1200,
+ duration: 60, // Duration in seconds
+});
+
export function getRateLimiter(
mode: RateLimiterMode,
token: string,
- plan?: string
+ plan?: string,
+ teamId?: string
) {
if (token.includes("a01ccae") || token.includes("6254cf9") || token.includes("0f96e673")) {
return testSuiteRateLimiter;
}
+ if(teamId === process.env.DEV_B_TEAM_ID) {
+ return devBRateLimiter;
+ }
+
const rateLimitConfig = RATE_LIMITS[mode]; // {default : 5}
if (!rateLimitConfig) return serverRateLimiter;