loginXml(credentials: Pick<LoginCredentials, "userHash" | "passwordHash">): string
Builds the XML body of the login request.
Build the login body
Build the login body
import { assertStringIncludes } from "@std/assert"; import { loginXml } from "@hertzg/reolink-api/protocol/login"; const xml = loginXml({ userHash: "USER", passwordHash: "PASS" }); assertStringIncludes(xml, "<userName>USER</userName>"); assertStringIncludes(xml, "<password>PASS</password>");
credentials: Pick<LoginCredentials, "userHash" | "passwordHash">
The hashes from loginCredentials.