Context
When service mode launches, verify() will make HTTP calls to the BurnerGuard API. Network calls fail — timeouts, 5xx errors, rate limiting, DNS issues. The library needs a clear, configurable strategy for what happens when the API is unreachable.
This is a must-have before service mode goes live.
Proposed behavior
Configuration
const guard = await BurnerGuard.create({
apiKey: 'bg_live_...',
fallback: 'static', // 'static' | 'throw' | 'allow'
serviceTimeout: 5000 // ms before falling back (default: 5000)
});
Fallback strategies
| Strategy |
Behavior |
Use case |
'static' (default) |
Fall back to local blocklist check |
Best of both worlds — never blocks legitimate users, still catches known disposable domains |
'throw' |
Throw an error |
Strict environments where you'd rather fail the request than risk letting a bad email through |
'allow' |
Return { isMatch: false } |
Permissive environments where you'd rather let a potentially bad email through than block a legitimate user |
Result indication
When a fallback occurs, the result should indicate it:
{
isMatch: true,
matchedOn: ['blocklist'],
isAllowlisted: false,
degraded: true, // indicates this was a fallback, not a full service check
degradedReason: 'timeout' // 'timeout' | 'serviceError' | 'rateLimited'
}
Retry behavior
- No automatic retries in the library — the consumer controls retry logic
- But expose enough info (
degradedReason) for the consumer to make retry decisions
Open questions
- Should
degraded and degradedReason be on VerifyResult (always present) or only on EnrichedVerifyResult?
- Should there be an
onDegradation callback for logging/alerting?
- Should the fallback strategy be overridable per-call via
VerifyOptions?
Acceptance criteria
Priority: 🟡 Medium — must-have before service mode launches
Context
When service mode launches,
verify()will make HTTP calls to the BurnerGuard API. Network calls fail — timeouts, 5xx errors, rate limiting, DNS issues. The library needs a clear, configurable strategy for what happens when the API is unreachable.This is a must-have before service mode goes live.
Proposed behavior
Configuration
Fallback strategies
'static'(default)'throw''allow'{ isMatch: false }Result indication
When a fallback occurs, the result should indicate it:
Retry behavior
degradedReason) for the consumer to make retry decisionsOpen questions
degradedanddegradedReasonbe onVerifyResult(always present) or only onEnrichedVerifyResult?onDegradationcallback for logging/alerting?VerifyOptions?Acceptance criteria
fallbackoption inBurnerGuardOptionswith'static','throw', and'allow'strategiesserviceTimeoutoptiondegradedanddegradedReasonfields in verify resultPriority: 🟡 Medium — must-have before service mode launches