Calling non-Airplane APIs
While views make it easy to integrate Airplane tasks using Task backed components or Manually executing tasks, there may be times when you want to call a non-Airplane backend API.
Wrap the API call in an Airplane task (recommended)
It's easy to create a small Airplane task that calls an API. By wrapping the API call in an Airplane task, you can utilize Task backed components which provide automatic data fetching, loading and error state.
The easiest way to call an API via Airplane task is by creating a REST task. Follow REST getting started to deploy a REST task that calls your API.
The body of your task should look something like:
Call the API directly from your view
If you do not want to wrap your API call in an Airplane task, you can call the API directly from your view using the built in
fetchAPI or another data fetching library.
Any secret API keys or other sensitive authentication pieces should not be included directly in a view.