WIP — This guide is being updated to reflect the latest OS workflows.
Installation
bun add @render-network/sdk
# or
yarn add @render-network/sdk
# or
npm install @render-network/sdk
Auth & Proxy Patterns
Use a server route (SSR/edge) to call backend APIs. Do not expose backend endpoints in frontend code.
// pages/api/tokens/balance.ts (Next.js example)
import type { NextApiRequest, NextApiResponse } from "next";
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
const auth = req.headers.authorization;
// forward to backend service securely
const r = await fetch(process.env.RNDR_BACKEND + "/balance", {
headers: { authorization: auth || "" }
});
res.status(r.status).send(await r.text());
}
Overlays API (Example)
import { RenderNetwork } from "@render-network/sdk";
const rn = new RenderNetwork({ wallet: yourWallet, network: "mainnet-beta" });
await rn.overlays.publish({
id: "main",
widgets: [
/* ... */
]
});
Themes API (Example)
await rn.themes.create({ name: "Pro", base: "dark", widgets: [] });
await rn.themes.publish("Pro");
Gamification Hooks (Example)
rn.events.on("prediction:update", (evt) => {
// update UI store
});
Quickstart
- Install SDK (see above)
- Implement server proxy for auth-protected routes
- Initialize client with wallet
- Publish a basic overlay and verify rendering
Cross-Links