Not to be confused with React Server
Functions; while they serve similar purposes,
Attio server functions have different requirements and therefore do not follow the RSC protocol.
.server.ts suffix. The file must export a default async function, which will serve as the
entry point for the server function. You can then import and call this function within the client
code.
Here is an example of using a server function to make
a request
to Outreach on behalf of a user.
TypeScript
addToSequence() function can be called from your client side code like:
try/catch or .catch
promise chaining.
Debugging
To check the output ofconsole.log() calls from inside server functions, open the Logs tab for your app in the Developer console.
Timeout
Server functions have a non-configurable 30 second timeout. If a server function takes longer than 30 seconds to complete, it will be terminated and a timeout error will be thrown.IP addresses
Outbound requests from server functions leave Attio’s infrastructure from a single IP address. In some environments with restrictive firewalls it might be necessary to allowlist this IP, and from time to time we might need to add a new IP address to our list. We’ll endeavour to provide you with as much notice as possible before we change these.Attio server function egress IP addresses
Webhooks are delivered from a different set of IP addresses. See webhook IP
addresses if you need to allowlist those too.