polarity-integration-utils
    Preparing search index...

    Interface UserCache

    User-scoped cache operations - specific to individual users Use for user preferences, recent activity, or personalized data

    interface UserCache {
        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 user cache

      Parameters

      • key: string

        The cache key to delete

      Returns Promise<void>

      Promise that resolves when the operation completes

      await cache.user.delete('preferences');
      
    • Get a value from user cache

      Parameters

      • key: string

        The cache key

      Returns Promise<unknown>

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

      const preferences = await cache.user.get('preferences');
      
    • Set a value in user 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.user.set('recent_lookups', lookups, { ttl: 3600 });