Summary
In this chapter, we’ve detailed how to use various types of APIs in an SPFx solution. We started by listing possible HTTP clients provided by the framework and where to access them. For Entra ID-secured APIs, such as the Microsoft Graph API, we explained the underlying mechanisms and prerequisites, discussing how SPFx is capable of doing the heavy lifting for you and getting access tokens on behalf of the current user to call protected APIs. For each type, we provided a clear usage example and highlighted important points to remember as a developer.
In the next chapter, we’ll see how to write tests to improve the development quality.