react2app.config.js
This is the one config file to set all your React2App configs .
react2app.config.js keeps all your app’s settings in one place — so you don’t have to jump around.
Should I have to create this file manually?
Well, if you followed our instructions on the Installation page, the file should already be placed at the root of your project. We’ve created it for you, so all you need to do is fill it out with your app’s information.
# This should create the file for you automatically
npx react2app dev
What you can set up in this file
You can think of it as a package.json
, but for your app.
Here’s what you can set up in react2app.config.js
:
- App Information: App’s name, Project Name, App ID, and version, etc.
- IOS Settings: Some iOS settings to build your app (Don’t worry, we’ll guide you through it)
- Android Settings: Some Android settings to build your app (Don’t panic! We’ll also guide you through it)
- Design Assets: Design related settings(Splash Screen, Icon, etc.)
- Others: Deep Linking, Environment Variables, etc.
Configurations
App Information
// react2app.config.js
{
projectName: null,
displayName: null,
appId: null,
productionUrl: "https://example.com",
version: "1.0.0",
scheme: "yourscheme"
...
}
Property | Type | Description |
---|---|---|
projectName | string | null | The internal name of your project |
displayName | string | null | The name shown to users |
appId | string | null | Unique identifier for your application |
productionUrl | string | The base URL for production environment |
version | string | Current version of your application |
scheme | string | URL scheme for deep linking |
iOS Configuration
// react2app.config.js
{
ios: {
teamId: process.env.N2A_IOS_TEAM_ID;
}
...
}
Warning: Ensure your Apple Developer Team ID is properly set in your environment variables.
Android Configuration
// react2app.config.js
{
android: {
keyStore: {
keystorePath: "./release.keystore",
keystorePassword: process.env.N2A_ANDROID_KEYSTORE_PASSWORD,
keyAlias: "upload",
keyPassword: process.env.N2A_ANDROID_KEY_PASSWORD
}
}
...
}
Important: Keep your keystore credentials secure and never commit them to version control.
Design Assets
{
// react2app.config.js
design: {
icon: "./react2app/design/icon.png",
splash: {
backgroundColor: "#ffffff",
image: "./react2app/design/splash.png",
imageWidth: 200
}
}
...
}
Splash Screen Properties
Property | Type | Description |
---|---|---|
backgroundColor | string | Background color in hex format |
image | string | Path to splash screen image |
imageWidth | number | Width of the splash image in pixels |
Environment Variables
The following environment variables must be set:
N2A_IOS_TEAM_ID
N2A_ANDROID_KEYSTORE_PASSWORD
N2A_ANDROID_KEY_PASSWORD
Error: Missing environment variables will cause build failures. Ensure all required variables are properly set.