DocsReact / Next.js
R

React / Next.js

Section Guide

Hook and Server blueprints.

Server API Bridge




typescript


'use server'

export async function dsiRequest(method: string, table: string, data: any = {}) {
const token = Buffer.from("PgcQqi8ZGmlnYwd50JKo74_secure_token_2024").toString('base64');
const ts = Buffer.from(Math.floor(Date.now() / 1000).toString()).toString('base64');

const res = await fetch("https://fake-api.devsecit.com/1.0.0/wb/", {
method: 'POST',
body: new URLSearchParams({ token, timestmp: ts, method, table, ...data })
});
return res.json();
}