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"
}
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
{
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
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.
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
- Keep your environment variables secure and never commit them to version control
- Store the keystore file in a secure location
- 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