Skip to Content
Next2App beta is released 🎉
DocsReferencesnext2app.config.js

next2app.config.js

Overview

The configuration file exports a JavaScript object that defines various settings for your application, including project details, URLs, versioning, platform-specific configurations, and design assets.

This configuration file should be placed at the root of your project and imported as needed.

Basic Configuration

Project Information

{ projectName: null, displayName: null, appId: null, productionUrl: "https://example.com", version: "1.0.0", scheme: "yourscheme" }
PropertyTypeDescription
projectNamestring | nullThe internal name of your project
displayNamestring | nullThe name shown to users
appIdstring | nullUnique identifier for your application
productionUrlstringThe base URL for production environment
versionstringCurrent version of your application
schemestringURL scheme for deep linking

iOS Configuration

{ ios: { teamId: process.env.N2A_IOS_TEAM_ID; } }

Warning: Ensure your Apple Developer Team ID is properly set in your environment variables.

Android Configuration

{ 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

{ design: { icon: "./next2app/design/icon.png", splash: { backgroundColor: "#ffffff", image: "./next2app/design/splash.png", imageWidth: 200 } } }

Splash Screen Properties

PropertyTypeDescription
backgroundColorstringBackground color in hex format
imagestringPath to splash screen image
imageWidthnumberWidth 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.

Usage Example

const config = require("./config"); // Access configuration values console.log(config.version); console.log(config.ios.teamId); console.log(config.design.splash.backgroundColor);

Best Practices

Follow these guidelines for optimal configuration management:

  • Keep environment variables secure
  • Update version numbers consistently
  • Test deep linking thoroughly
  • Follow platform-specific security guidelines
  • Maintain secure keystore management
  • Use relative paths from project root

Security Considerations

  1. Keep your environment variables secure and never commit them to version control
  2. Store the keystore file in a secure location
  3. Follow platform-specific security best practices for iOS and Android configurations

Notes

  • All paths are relative to the project root
  • Make sure to update the version number when releasing new updates
  • Test the URL scheme thoroughly for deep linking functionality
Last updated on