You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for responding so quicky. I'd like my native host app (android/ios) to be able to provide runtime configuration for my react native SDK. It should be possible to read environment variables, however file based configuration would be more practical. It would be ideal, if I could stay mostly in the react native word, without having to create native classes. Can you point me to the right direction?
Yeah, "runtime" and "env variables" are on quite opposite ends. We recently created Brownie, which as two-way data storage for brownfield, so you can exchange data between native and React Native. Maybe this is what you're looking for?
Sorry, Im new to brownfield development, and thanks for the pionter, but I'm not looking for a state management solution. Allow me to clarify.
I have a native host app that consumes my SDK as an aar I built with rock. The native host app should be able to provide configuration values for this SDK, like APP_ENV. Configuration should be done at build time of the native host app, not at build time of the SDK. Does that make sense?
From what I know my options are
Passing configuration as intial props for the RN root view
Write configuration to shared storage and read at SDK start
The shared storage approach is not ideal when configuring secrets. So my current solution is to provide native code to pass values as initialprops, which i then store in memory for my RN views.
Is it possible to provide configuration via native files (manifest, gradle.properties, ..) without having to write custom native code? I thought react-native-brownfield or rock already covers this, thats how I came to this issue.
Since the build steps are separate for React Native app (your SDK) and for your native app, I don't think there's a clear way of achieving that. But the initialProps mechanism is designed exactly for this use case – it's considered a best practice to pass data from native app (e.g. read through your .env or manifest) and pass that to React Native view as initial props. Anything that you can't achieve with that or you don't feel safe for any reason?
Activity
FabianUntermoser commentedon Jan 28, 2026
Any update on this? Id like for my native host app to be able to configure parts of the SDK I build with rock.
thymikee commentedon Jan 28, 2026
This issue is very much outdated. What is the use case that you’re chasing after?
FabianUntermoser commentedon Jan 28, 2026
Thanks for responding so quicky. I'd like my native host app (android/ios) to be able to provide runtime configuration for my react native SDK. It should be possible to read environment variables, however file based configuration would be more practical. It would be ideal, if I could stay mostly in the react native word, without having to create native classes. Can you point me to the right direction?
thymikee commentedon Jan 28, 2026
Yeah, "runtime" and "env variables" are on quite opposite ends. We recently created Brownie, which as two-way data storage for brownfield, so you can exchange data between native and React Native. Maybe this is what you're looking for?
FabianUntermoser commentedon Jan 29, 2026
Sorry, Im new to brownfield development, and thanks for the pionter, but I'm not looking for a state management solution. Allow me to clarify.
I have a native host app that consumes my SDK as an aar I built with rock. The native host app should be able to provide configuration values for this SDK, like
APP_ENV. Configuration should be done at build time of the native host app, not at build time of the SDK. Does that make sense?From what I know my options are
The shared storage approach is not ideal when configuring secrets. So my current solution is to provide native code to pass values as initialprops, which i then store in memory for my RN views.
Is it possible to provide configuration via native files (manifest, gradle.properties, ..) without having to write custom native code? I thought react-native-brownfield or rock already covers this, thats how I came to this issue.
thymikee commentedon Jan 29, 2026
Since the build steps are separate for React Native app (your SDK) and for your native app, I don't think there's a clear way of achieving that. But the
initialPropsmechanism is designed exactly for this use case – it's considered a best practice to pass data from native app (e.g. read through your .env or manifest) and pass that to React Native view as initial props. Anything that you can't achieve with that or you don't feel safe for any reason?FabianUntermoser commentedon Jan 30, 2026
IF this is the intended way, then its ok. I didn't know if I should be doing something different. Thanks!
thymikee commentedon Jan 30, 2026
Yeah you're good to go @FabianUntermoser! Feel free to DM me if you need any help further