Skip to main content
Go to Latest
interface IHitCacheImplementation
import { type IHitCacheImplementation } from "https://deno.land/x/flagship_io_js_sdk@3.0.11/mod.ts";

Methods

cacheHit(visitorId: string, data: HitCacheDTO): Promise<void>

This method will be called to cache visitor hits when a hit has failed to be sent if there is no internet, there has been a timeout or if the request responded with something > 2XX.

lookupHits(visitorId: string): Promise<HitCacheDTO[]>

This method will be called to load hits corresponding to visitor ID from your database and trying to send them again in the background. Note: Hits older than 4H will be ignored

flushHits(visitorId: string): Promise<void>

This method will be called to erase the visitor hits cache corresponding to visitor ID from your database.