Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

742 B
Raw Blame
export async function getAgentAuthData(agentId: string) {
  try {
    const authData = await fetch(`/api/page/builder/agent-auth/${agentId}`, {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
      },
    }).then((res) => res.json());

    return authData.data;
  } catch (error) {
    throw error;
  }
}

export async function saveAgentAuthData(agentId: string, authData: any) {
  try {
    const response = await fetch(`/api/page/builder/agent-auth/${agentId}`, {
      method: 'PUT',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(authData),
    });
    const result = await response.json();

    return result;
  } catch (error) {
    throw error;
  }
}