DecoLens SDK
    Preparing search index...

    Class DecoLensClient

    The main client for interacting with the DecoLens API.

    Index

    Constructors

    • Creates a new DecoLensClient instance.

      Parameters

      • apiKey: string

        Your DecoLens API key. Make sure this is the "client" API key generated via the admin console.

      • baseUrl: string = 'https://api.decolens.com/api/v1'

        Optional. The base URL of the DecoLens API endpoint, if you need to override the default.

      Returns DecoLensClient

    Methods

    • Analyzes an image of a room/space to determine its purpose and aesthetics, and provide artwork recommendations.

      Parameters

      • imageUrl: string

        The URL or data URI of the image to analyze.

      • preferences: Preferences = {}

        User preferences for the analysis. Optional.

      • callback: AnalysisCallback

        Callback functions to handle partial, complete, and error events.

      Returns Promise<AbortController>

      An AbortController that can be used to cancel the analysis.

    • Searches for artworks based on a natural language query. Query must be at least 3 characters.

      Parameters

      • query: string

        The search query.

      • maxCount: number = 5

        The maximum number of results to return (default: 5).

      • tags: string[] = []

        Array of tags to filter by. Artworks will be returned if they match ANY of the tags specified. Optional.

      Returns Promise<{ artworkIds: string[] }>

      A Promise that resolves to an array of artwork IDs.

    • Finds artworks similar to a given artwork.

      Parameters

      • artworkId: string

        The ID of the artwork to find similar artworks for.

      • maxCount: number = 5

        The maximum number of results to return (default: 5).

      • tags: string[] = []

        Array of tags to filter by. Artworks will be returned if they match ANY of the tags specified. Optional.

      Returns Promise<{ artworkIds: string[] }>

      A Promise that resolves to an array of artwork IDs.