Skip to main content
Not everything in an app can safely or efficiently happen on the user’s device. Some tasks need extra security, reliability, or processing power. That’s where server functions (sometimes called edge functions) come in. Server functions handle important work behind the scenes, like talking to your database, checking permissions, or processing payments. Instead of running this logic directly in a user’s browser or mobile app, where it could be slower or less secure, the function runs on a server. This keeps sensitive information safe and makes sure your app behaves consistently for every user. Common use cases include:
  • Handling payments, authentication, or other sensitive logic
  • Receiving webhooks from third-party services like Stripe or GitHub
  • Generating images or social preview cards on demand
  • Calling external AI APIs like OpenAI
  • Sending transactional emails
  • Building messaging bots for Slack, Discord, or other platforms
Watch the video below for an introduction to using APIs and server functions in your app:

View server functions

To open the server functions settings for your project’s database:
  1. Open your Bolt project.
  2. In the top center of the screen, click the database icon.
  3. Click Server Functions.
The Server Functions page in the Bolt Database settings.
The Server Functions screen displays all server-side (edge) functions that exist in your project. You can use the list to track and debug the backend logic that runs alongside your database.

View logs

To view logs for a server function, click View Logs. You can see activity from the past hour.
The logs screen in the Server Functions page with a list of log records and a View Logs button.
To view details for an individual record, click View Log Details to see its JSON record:
The JSON log details panel for a server function record.

Update server functions

Bolt deploys your server functions for you, both when it creates them and when it updates them. If you change a server function yourself, the change isn’t live until you ask Bolt to deploy it.
If you prefer to review server function changes before they go live, add this to your project knowledge:
Then, Bolt writes changes to the server-function-drafts folder for you to review and doesn’t deploy the functions until you say so. You won’t see changes on the Server Functions page until Bolt deploys them.

Deploy server functions you change yourself

If you manually change a server function in Code view, in the terminal, or in your connected GitHub repository, Bolt doesn’t automatically deploy the change, even when you publish your site. You need to ask Bolt to update the server function so your project uses the updated version. When Bolt updates your server functions, it deploys every function that’s changed since the last deploy. There’s no way to redeploy only one specific function. Before you ask Bolt to deploy your server functions, make sure any changes to other functions are ready to go live, too. To deploy server function changes yourself:
  1. Check the current number of deployments on your server functions:
    1. In the top center of the screen, click the database icon, then click Server Functions.
    2. In the Deployments column, check the number for each function.
  2. In the chatbox, send this prompt:
  3. After Bolt finishes, close and reopen (or refresh) the Server Functions page in your database settings to see the updated deployment count.
  4. In the Deployments column, check that the number for each function you changed went up by one. This confirms that the deployment was successful.
If Bolt replies that no server functions changed, ask Bolt to add a comment at the top of each function file you changed and then deploy again. The comment doesn’t change how the function works; it only triggers Bolt to retry the deployment.

Delete server functions

Only delete a server function if your project isn’t using it and you no longer need the function or its logs. You can’t undo this action.
To delete a server function:
  1. Open your Bolt project.
  2. In the top center of the screen, click the database icon, then click Server Functions.
  3. Find the function you want to delete, then click the trash can icon.
  4. Click Delete to confirm.