react-native-config

react-native-config
Photo by Rahul Mishra / Unsplash

Install the library using

npm i react-native-config

After installing library create .env file at the root of your project with following code

# DEV, STAGE, PROD
APP_PROFILE=DEV
API_BASE_URL=http://10.0.1.32:6055/health-tracker
TENANT_ID=health-tracker

By plugin this config library we have to manually add code in 'android/app/build.gradle' file

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

Create a configs folder in src with 'AppConfig.js' and 'index.js' files with following code

import Config from 'react-native-config';

export default {
  APP_PROFILE: Config.APP_PROFILE,
  API_BASE_URL: Config.API_BASE_URL,
  TENANT_ID: Config.TENANT_ID,
  EXPERIMENTAL_FEATURES: {},
};
``
import AppConfig from './AppConfig';

export {AppConfig};

Now we have to access .env file fields by importing Appconfig file

Read more

Retrieval-Augmented Generation (RAG): A Complete Guide to Architecture, Workflow, Use Cases, and Implementation

Retrieval-Augmented Generation (RAG): A Complete Guide to Architecture, Workflow, Use Cases, and Implementation

Category: Artificial Intelligence | Generative AI | Software Engineering 1. Introduction Large Language Models (LLMs) have transformed how applications interact with users by enabling natural language understanding, content generation, summarization, and conversational experiences. However, traditional LLMs have limitations. They may not know an organization's private information, may lack access to

By Sangram Ekshinge