Skip to content

Client

Basic setup

import { createRenClient, pat } from "@renai-labs/sdk"
const client = createRenClient({
baseUrl: "https://api.renai.build",
auth: pat(process.env.REN_PAT_TOKEN!),
})

Configuration

OptionDescription
baseUrlAPI base URL.
authAuth strategy (e.g. pat(token)). Required.
headersExtra headers sent with every request.
fetchCustom fetch implementation.
credentialsRequestCredentials value.

Custom headers

createRenClient({
baseUrl,
auth: pat(token),
headers: { "X-Request-Id": crypto.randomUUID() },
})

Custom fetch

createRenClient({
baseUrl,
auth: pat(token),
fetch: myCustomFetch,
})