Component demos
This page contains demo content for testing and showcasing various documentation components. It’s hidden from navigation but can be linked to from examples.
API client examples
PlantClient
The PlantClient class is the main entry point for interacting with the Plant Store API. It handles authentication, request management, and provides access to all API endpoints.
Constructor parameters:
apiKey(string, required): Your API authentication keybaseUrl(string, optional): Custom API base URL for testingtimeout(number, optional): Request timeout in milliseconds
Example usage:
PlantConfig
Configuration object for customizing the Plant Store SDK behavior.
Properties:
retryAttempts(number): Number of retry attempts for failed requestscacheEnabled(boolean): Enable response cachinglogLevel(string): Logging verbosity level
createPlant
Creates a new plant entry in the database.
Parameters:
name(string, required): Common name of the plantspecies(string, required): Scientific species namedescription(string, optional): Plant descriptioncareLevel(string, optional): Care difficulty level
Returns: Promise resolving to the created plant object
Example:
API method examples
create_plant
Python method for creating a new plant entry.
Signature:
fetchPlants
Retrieves a list of plants from the API with optional filtering.
Parameters:
filters(object, optional): Filter criterialimit(number, optional): Maximum number of resultsoffset(number, optional): Pagination offset
Returns: Promise resolving to an array of plant objects
Type definitions
PlantStore
The PlantStore class manages plant data storage and retrieval operations.
Constructor parameters:
apiKey(string, required): Your API authentication keyconfig(PlantConfig, optional): Configuration options
PlantClient
The PlantClient class provides a client interface for interacting with PlantStore.
Constructor parameters:
store(PlantStore, required): PlantStore instance to use
PlantResponse
Response object returned from plant-related API calls.
Properties:
plants(Array): List of plant objectstotal(number): Total count of plantshasMore(boolean): Whether more results are available
Get methods
Common retrieval methods for accessing plant store resources.