For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
预约演示登录免费开始
  • 入门
    • 概览
    • 工作原理
    • 快速开始
    • 项目结构
    • Customer showcase
    • 变更日志
  • 配置
    • 概览
    • 站点级设置
    • 页面级设置
  • 编写内容
    • Markdown 基础
    • Markdown 中的富媒体
    • Fern 编辑器
    • 可复用代码片段
    • 组件演示
  • AI 功能
    • 概览
    • Fern Writer
    • AI 生成的示例
    • Markdown 访问
      • 概览
      • Agent 指令
      • 智能体指令
      • 分析与集成
    • MCP 服务器
    • API 目录发现
  • Public API
    • GETJWT from Fern API key
    • GETAlgolia search credentials
    • GETCurrent user information
  • Fern Writer API
    • GETGet Fern Writer Install Link
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
预约演示登录免费开始
在本页
  • API 客户端示例
  • PlantClient
  • PlantConfig
  • createPlant
  • API 方法示例
  • create_plant
  • fetchPlants
  • 类型定义
  • PlantStore
  • PlantClient
  • PlantResponse
  • Get 方法
编写内容

组件演示

||以 Markdown 格式查看|
此页面是否有帮助?
在仪表板中编辑
上一个

可重复使用的片段

下一个

AI 功能

此页面包含用于测试和展示各种文档组件的演示内容。它在导航中隐藏,但可以从示例中链接到。

API 客户端示例

PlantClient

PlantClient 类是与植物商店 API 交互的主要入口点。它处理身份验证、请求管理,并提供对所有 API 端点的访问。

构造函数参数:

  • apiKey(string,必需):您的 API 身份验证密钥
  • baseUrl(string,可选):用于测试的自定义 API 基础 URL
  • timeout(number,可选):请求超时时间(毫秒)

使用示例:

1import { PlantClient } from "@plantstore/sdk";
2
3const client = new PlantClient({
4 apiKey: "your-api-key-here"
5});

PlantConfig

用于自定义植物商店 SDK 行为的配置对象。

属性:

  • retryAttempts(number):失败请求的重试次数
  • cacheEnabled(boolean):启用响应缓存
  • logLevel(string):日志详细程度级别

createPlant

在数据库中创建新的植物条目。

参数:

  • name(string,必需):植物的通用名称
  • species(string,必需):科学物种名称
  • description(string,可选):植物描述
  • careLevel(string,可选):护理难度级别

返回: 解析为已创建植物对象的 Promise

示例:

1const plant = await client.createPlant({
2 name: "Monstera",
3 species: "Monstera deliciosa",
4 careLevel: "easy"
5});

API 方法示例

create_plant

用于创建新植物条目的 Python 方法。

签名:

1def create_plant(
2 name: str,
3 species: str,
4 description: Optional[str] = None,
5 care_level: Optional[str] = None
6) -> Plant

fetchPlants

从 API 检索植物列表,支持可选过滤。

参数:

  • filters(object,可选):过滤条件
  • limit(number,可选):结果的最大数量
  • offset(number,可选):分页偏移量

返回: 解析为植物对象数组的 Promise

类型定义

PlantStore

PlantStore 类管理植物数据存储和检索操作。

构造函数参数:

  • apiKey(string,必需):您的 API 身份验证密钥
  • config(PlantConfig,可选):配置选项

PlantClient

PlantClient 类提供与 PlantStore 交互的客户端接口。

构造函数参数:

  • store(PlantStore,必需):要使用的 PlantStore 实例

PlantResponse

从植物相关 API 调用返回的响应对象。

属性:

  • plants(Array):植物对象列表
  • total(number):植物总数
  • hasMore(boolean):是否有更多结果可用

Get 方法

访问植物商店资源的常见检索方法。

方法描述参数返回
getPlant通过 ID 检索单个植物plant_id(string,必需):植物的唯一标识符植物对象
getGarden通过 ID 检索单个花园garden_id(string,必需):花园的唯一标识符花园对象