Beignet API reference
    Preparing search index...

    Contract builder exports.

    • Create a new HTTP contract builder.

      Most apps prefer createContractGroup().namespace(...).prefix(...) for related feature contracts. Use this lower-level factory when a standalone contract is clearer.

      Type Parameters

      • TMethod extends HttpMethod
      • const TPath extends string

      Parameters

      Returns ContractBuilder<
          TMethod,
          null,
          null,
          null,
          null,
          Record<never, never>,
          ContractMeta,
          TPath,
      >

      A fluent contract builder.

      const getTodo = createContract({
      method: "GET",
      path: "/api/todos/:id",
      })
      .pathParams(z.object({ id: z.string() }))
      .responses({ 200: TodoSchema });