Inline RPC
Inline RPC is a function that allows you to execute a one-time RPC call on the fly without creating an instance of the Surreal
class. Its usage is almost identical to the .rpc()
method. However, note that JsonFormatter
is used by default.
Import
import { rpc } from "@tai-kun/surrealdb";
Example
import { rpc } from "@tai-kun/surrealdb";
const token = await rpc("http://127.0.0.1:8000", "signin", { params: [{ user: "root", pass: "root", }],});