Skip to main content
This guide will help you set up New Expensify for local development across all platforms.

Prerequisites

Before you begin, ensure you have the following installed:

Node.js

Version 20.20.0 (use nvm for easy version management)

npm

Version 10.8.2 (comes with Node.js)

Watchman

Required for React Native file watching

nvm

Recommended for Node.js version management

Getting Started

1

Install nvm and Node.js

Install nvm, then use it to install the correct Node.js version:
brew install nvm && nvm install
The project uses strict Node and npm versions defined in package.json and .nvmrc. The npm install command will fail if you’re not using the correct versions.
2

Install Watchman

Watchman is required for React Native’s file watching:
brew install watchman
3

Install Dependencies

Install all project dependencies:
npm install
For standalone builds, use:
npm run install-standalone
4

Run the Application

Start the development server for your desired platform:
# Web
npm run web

# iOS
npm run ios

# Android
npm run android

Platform-Specific Setup

Web Development Setup

Configure HTTPS

The webpack development server uses HTTPS. On macOS, you can run:
npm run setup-https
This installs mkcert and generates valid certificates for dev.new.expensify.com and localhost.For other operating systems:
  1. Install mkcert
  2. Generate certificates:
    mkcert -install
    mkcert -cert-file config/webpack/certificate.pem -key-file config/webpack/key.pem dev.new.expensify.com localhost 127.0.0.1
    

Configure Local Hosts

Add this entry to your /etc/hosts file:
127.0.0.1 dev.new.expensify.com

Run Development Server

npm run web
The app will be available at https://dev.new.expensify.com:8082

Build for Production

To test a production build locally:
# 1. Build the production bundle
npm run build

# 2. Run the distribution server
npm run web:dist
Access at http://localhost:8080

Environment Variables

Creating a .env file is not necessary for external contributors. It can lead to errors when variables get updated since your local .env file is ignored.

Key Environment Variables

VariableDescription
NEW_EXPENSIFY_URLRoot URL for the website
SECURE_EXPENSIFY_URLURL for the Expensify secure API
EXPENSIFY_URLURL for the Expensify API
EXPENSIFY_PARTNER_NAMEConstant for app authentication
EXPENSIFY_PARTNER_PASSWORDConstant for app authentication (OK to be public)
PUSHER_APP_KEYKey for Pusher.com authentication
USE_WEB_PROXYStart proxy server for API requests (set to true for external contributors)

Optional Performance Variables

VariableDescription
CAPTURE_METRICSCapture performance metrics in Flipper
ONYX_METRICSCapture additional performance metrics
USE_WDYREnable Why Did You Render testing
USE_REDUX_DEVTOOLSEnable Redux DevTools for Onyx state debugging
If your .env changes aren’t working, try rm -rf .rock and re-run your platform command.

Running Tests

npm run test

Common Issues

If you see CORS errors in the browser console:
Access to fetch at 'https://www.expensify.com/api/BeginSignIn' from origin 'http://localhost:8080' has been blocked by CORS policy
You likely have a misconfigured .env file. Remove it and try again:
rm .env
If npm install fails with a version error:
  1. Install nvm: brew install nvm
  2. Use the correct version: nvm install
  3. Set up automatic switching for zsh or bash
If you’re having HTTPS certificate issues:
  1. Ensure mkcert is installed: brew install mkcert
  2. Run: npm run setup-https
  3. Check that /etc/hosts contains: 127.0.0.1 dev.new.expensify.com
If you’re having MapBox SDK download issues:
  1. Run: npm run configure-mapbox
  2. Follow the prompts to set up your token
  3. See this Slack thread for Expensify employees

Next Steps

Authentication

Learn how to sign in and manage your session

Workspaces

Create and configure your first workspace

Contributing

Start contributing to the project

Architecture

Understand the codebase structure

Build docs developers (and LLMs) love