How to make HTTP requests from your app with server functions
attioFetch
. App SDK does not allow
client-side fetch requests, so all HTTP requests must go through server functions, which run inside
a secure sandbox within the Attio infrastructure. The server function runtime is not Node.js
compatible, meaning some libraries that work in Node.js might not work in our environment.
.server.ts
suffix. The file can be placed anywhere in your app, but it must export default
an async function. This function acts as the entry point for the server function.
addToSequence()
function can be called from your client by simply importing it and calling it with the required arguments.
JSON.stringify(JSON.parse(...))
.try/catch
or .catch
promise chaining.
console.log()
placed inside the server functions, open the Logs tab for your app in the Developer Portal.