Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How to use dev/staging/prod for API calls?

Issue

As a user, I need to be able to use different URLs for API calls on different environments, such as dev and staging, but this feature is not yet available. I have found a workaround by creating separate workspaces for each environment.

Resolution

The solution to using different URLs for API calls on each environment involves creating separate workspaces for each environment and treating them as separate entities. In these workspaces, different datasources can be created with different URLs based on the environment settings.

For example, if there are two environments - dev and staging - two separate workspaces can be created for them. In the dev workspace, the datasource can be configured with the dev API URL, whereas in the staging workspace, the datasource can be configured with the staging API URL.

This approach ensures that the API calls are made to the appropriate URL, based on the environment settings. Although the multiple environments feature is still in the works, this workaround can be used to achieve the desired functionality.

Overall, using multiple workspaces and configuring them with different datasources is a simple and effective way to implement different URLs for API calls in different environments.