Work with data in Forge
10 min
By the end of this lesson, you’ll be able to:
- Fetch data from Atlassian REST APIs using the Forge API.
- Use requestJira, requestConfluence, requestBitbucket and requestGraph.
- Store and retrieve data using Forge storage APIs.
- Make calls to external APIs securely.
Why data matters in Forge apps
Before a Forge app can be truly useful, it needs to work with data, for example, by pulling information from Jira work items, saving a user’s preferences, or integrating with third-party services. Knowing how to retrieve, store, and update this data is key to building useful apps.
👉 For example: you might want to:
- Display details from a Jira work item inside a custom panel
- Store a user’s input from a form
- Call an external service to get live data
Let’s look at how you can do all of it using Forge’s built-in tools.
Fetch data from the Atlassian Cloud
When you build apps with Forge, you’ll often need to retrieve information such as work item details, page content, or repository data from Atlassian apps like Jira, Confluence, or Bitbucket. Forge makes this possible by providing built-in methods to call Atlassian’s APIs directly. These methods handle authentication automatically and respect the permissions defined in your manifest.yml file.
How you access these APIs depends on where in your app the request is made:
- From the backend (your app's resolver functions), use the @forge/api package. This is the most common and flexible method, and it supports calling Atlassian REST APIs as well as external APIs.
- From the frontend (your app’s user interface), you can't call APIs directly. Instead, use the @forge/bridge package to invoke backend functions that do the actual API work using @forge/api.
Here are the main types of API requests you can use in Forge:
To use these, you need to import the Forge API package in your app using:
import api, { route } from '@forge/api';
👇Click the boxes below to learn more about each type of API request.
Store and retrieve data
Managing data storage is essential for app functionality. Forge offers storage APIs that allow you to store and retrieve data securely.
Data storage is essential for most Forge apps, whether you’re saving user settings, caching external data, or persisting state across sessions. Forge provides several storage options depending on the complexity and structure of your data.
Forge supports three main types of storage, each suited for different use cases.
👇Click the tabs below to learn more about each use case.
This is the most commonly used and simplest form of storage. It lets you store and retrieve values using string keys. It's great for simple data like flags, preferences, and counters.
Example: Store a user’s preferred currency setting for a budgeting app.
Key: currency
Value: GBP
Key: currency
Value: GBP
Key features of Forge storage
Forge provides secure, scalable storage options that make it easy to store and retrieve data across app sessions and environments. In addition to saving data, Forge storage includes built-in features that make app development easier and meet the needs of larger organizations.
👇Click the boxes below to learn more about a few core features.
Want to see how to interact with storage through code or the CLI? You'll find examples and deeper technical guidance in the Forge Storage API reference documentation.