Last updated Sep 26, 2023

🛠️ Level 1: Forge Novice

Preparing Your Forge Toolkit

Before any great developer sets off on their quest, they must first gear up. Think of this as forging your sword, gathering supplies, and unlocking the map—your first milestone in the adventure ahead.

FYI, to build apps with Forge, you’ll be using JavaScript. It’s also helpful to be familiar with React.

🎯 Objective: Set Up Your Dev Environment

To complete this stage, you'll need to gather the essential tools in your inventory:

  1. đź”§ Install Node.js

    Forge requires a Long-Term Support (LTS) version. Choose the one fit for your operating system and follow the setup guide.

  2. 🧙‍♂️ Install the Forge CLI

    The Command Line Interface (CLI) is your magic wand—your primary way to cast commands and deploy apps. You’ll use it to create, build, and manage everything on your journey.

  3. 🗝️ Authenticate with an Atlassian API Token

    Think of this as your access rune—connecting your Forge powers with your Atlassian identity.

  4. 🏰 Set Up Your Atlassian Developer Test Site

    This is your personal sandbox realm where you can safely build, test, and tinker without fear of breaking anything in production.

After installing the Forge CLI, checkout the Forge CLI docs to get acquainted with each command.

The Forge CLI won’t run without a properly installed LTS version of Node.js. Be sure to follow the Node.js setup instructions for your system before continuing.

Set up Node.js

The Forge CLI requires a fully supported LTS release of Node.js installed; namely, versions 18.x, 20.x or 22.x.

Forge developers on macOS should use Node Version Manager (nvm) to configure the environment.

  1. Install nvm.

  2. Select the latest Node.js LTS release by running the following in the terminal:

    1
    2
    nvm install --lts
    nvm use --lts
    

If nvm command doesn't work, try restarting the terminal.

  1. Check your Node.js version, run the following in the terminal:

    1
    2
    node --version
    

Which outputs your node version.

(Optional) Node.js installer

Skip this step if you have successfully completed Set up Node.js section.

You can install Node.js using the macOS installer, however this results in permission errors when working with the Forge CLI. If you must use the installer, you'll need to enable unsafe permissions to use the Forge global package when installing Node.js using this method.

  1. Download the LTS installer from Node.js.

  2. Install the package.

  3. Configure npm, permitting unsafe permissions:

    1
    2
    npm config set unsafe-perm true
    

Install the Forge CLI

Install the Forge CLI using npm. You’ll install the CLI globally so that the commands can be run across your system.

  1. Install the Forge CLI globally by running:

    1
    2
    npm install -g @forge/cli
    
  2. Verify that the CLI is installed correctly by running:

    1
    2
    forge --version
    

You should see a version number reported in the terminal. If a version number is not shown then the installation failed. Repeat step 1 and look for errors reported in the terminal.

With the CLI installed, view the complete list of Forge commands by running forge --help.

Log in with an Atlassian API token

Create or use an existing Atlassian API token to log in to the CLI. The CLI uses your token when running commands.

  1. Go to https://id.atlassian.com/manage/api-tokens.
  2. Click Create API token.
  3. Enter a label to describe your API token. For example, forge-api-token.
  4. Click Create.
  5. Click Copy to clipboard and close the dialog.

Log in to the Forge CLI to start using Forge commands.

Do not use sudo or root user when running forge. Doing so may cause issues with file permissions and ownership, potentially leading Forge CLI not functioning properly when run by a non-privileged user.

  1. Start the process by running:

    1
    2
    forge login
    
  2. You'll be asked whether to allow Forge to collect usage analytics data:

    1
    2
    Allow Forge to collect CLI usage and error reporting information?
    

    Answering Yes will allow Forge to collect data about your app's deployments and installations (including error data). This, in turn, helps us monitor Forge's overall performance and reliability. The collected data also helps us make better decisions on improving Forge's feature set and performance.

    For information about how Atlassian collects and handles your data, read our Privacy Policy.

  3. Enter the email address associated with your Atlassian account.

  4. Enter your Atlassian API token. You copied this to the clipboard in step 5.

You will see a message similar to this confirming you are logged in:

1
2
âś” Logged in as Adventurer Charlie

The Forge CLI uses your operating system's keychain to securely store your login details. Any command after forge login that requires authentication will read your credentials from the keychain. When this occurs, your keychain may prompt you for access; approve it to allow the CLI to run the command.

On Linux, you'll need libsecret installed to perform this step.

Signing up for a Developer Test Instance

To install and test your app, you'll need to create a test site for it. For Confluence and Jira apps, you need an Atlassian cloud developer site; for Bitbucket apps, you'll need a shared Bitbucket team space.

The Atlassian Marketplace doesn't currently support cross-product apps. If your app supports multiple products, you can publish two separate listings on the Marketplace, but your app won't be able to make API calls across different products and instances/installations.

Jira and Confluence: set up a cloud developer site

Creating an Atlassian cloud developer site allows you to install and test your app with Confluence and Jira products set up for you. You can install your app to multiple Atlassian sites however, app data won't be shared between separate Atlassian sites, products, or Forge environments.

  1. Go to http://go.atlassian.com/cloud-dev and create a site using the email address associated with your Atlassian account.
  2. Once your site is ready, log in and complete the setup wizard.

The limits on the numbers of users you can create are as follows:

  • Confluence: 5 users
  • Jira Service Management: 1 agent
  • Jira Software and Jira Work Management: 5 users

Next - Essential Knowledge

Now that you've set up your development environment, and a test site, it's time to review essential Forge knowledge.

Rate this page: