MCPcopy Index your code
hub / github.com/simstudioai/sim / getRateLimitKey

Method getRateLimitKey

apps/sim/lib/core/rate-limiter/rate-limiter.ts:42–50  ·  view source on GitHub ↗
(userId: string, subscription: SubscriptionInfo | null)

Source from the content-addressed store, hash-verified

40 }
41
42 private getRateLimitKey(userId: string, subscription: SubscriptionInfo | null): string {
43 if (!subscription) return userId
44
45 if (isOrgScopedSubscription(subscription, userId)) {
46 return subscription.referenceId
47 }
48
49 return userId
50 }
51
52 private getCounterType(triggerType: TriggerType, isAsync: boolean): RateLimitCounterType {
53 if (triggerType === 'api-endpoint') return 'api-endpoint'

Calls 1

isOrgScopedSubscriptionFunction · 0.90

Tested by

no test coverage detected