For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/sdk/sapi/service/functions/createServiceClient.md.
  • 简体中文
  • Function: createServiceClient()

    function createServiceClient(
       moduleId: string, 
       token: string, 
       inTx?: () => boolean): ServiceClient;

    Defined in: sapi/service/client.ts:114

    创建绑定到指定模块身份的 service 客户端(推荐路径)。

    Parameters

    ParameterTypeDescription
    moduleIdstring模块唯一标识符。
    tokenstring模块专属访问 token。
    inTx() => boolean检查配对 DbClient 是否处于事务中的探针(默认恒 false)。

    Returns

    ServiceClient