API ReferenceVariables
RECOMMENDED_THROTTLE_RULES
Variable: RECOMMENDED_THROTTLE_RULES
const RECOMMENDED_THROTTLE_RULES: ThrottleRule[];Defined in: transport/throttle.ts:172
Recommended starter rules tuned for human-cadence anti-spam friendliness against Snap's web endpoints.
Remarks
Each entry is calibrated to what a real human user would plausibly do:
- Mutations (
/JzFriendAction/,/FriendRequests/) —1500msfloor. Humans don't add or unfriend at sub-second cadence. - Friend roster sync (
/AtlasGw/SyncFriendData) —5000msfloor. Snap rate-limits sustained roster polling aggressively. - Public-info lookups (
/AtlasGw/GetSnapchatterPublicInfo) —100msfloor with aburst: 10allowance, modelling the in-app prefetch behaviour for chat-row avatars and friend-grid hydration. - Search (
/search/search) —300msfloor, modelling debounced typing in the browser search box.
Consumers opt in by importing this and passing it as
throttle: { rules: RECOMMENDED_THROTTLE_RULES } (per-instance) or
throttle: createSharedThrottle({ rules: RECOMMENDED_THROTTLE_RULES })
(shared across instances).
Example
import { SnapcapClient, RECOMMENDED_THROTTLE_RULES } from "@snapcap/native";
const client = new SnapcapClient({
dataStore, username, password,
throttle: { rules: RECOMMENDED_THROTTLE_RULES },
});