Inline RPC
Inline RPC is a function that allows you to execute a one-time RPC call without creating an instance of the Surreal
class. Its usage is very similar to the .rpc()
method. Note, however, 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", }],});