polarity-integration-utils
    Preparing search index...

    Interface GlobalCache

    Global cache operations - shared across all integrations and users Use for system-wide statistics, feature flags, or shared configuration

    interface GlobalCache {
        delete(key: string): Promise<void>;
        get(key: string): Promise<unknown>;
        set(key: string, value: unknown, options?: CacheOptions): Promise<void>;
    }
    Index

    Methods

    Methods

    • Delete a value from global cache

      Parameters

      • key: string

        The cache key to delete

      Returns Promise<void>

      Promise that resolves when the operation completes

      await cache.global.delete('feature_flags');
      
    • Get a value from global cache

      Parameters

      • key: string

        The cache key

      Returns Promise<unknown>

      Promise that resolves to the cached value or null if not found

      const totalLookups = await cache.global.get('total_lookups') || 0;
      
    • Set a value in global cache

      Parameters

      • key: string

        The cache key

      • value: unknown

        The value to cache (must be JSON serializable)

      • Optionaloptions: CacheOptions

        Cache options including TTL

      Returns Promise<void>

      Promise that resolves when the operation completes

      await cache.global.set('total_lookups', count + 1, { ttl: 86400 });