rollbar/rollbar-react-native

Support change environment while app is live

Ahmadhmaid777 opened this issue · 1 comments

My app supported change environment while is live my issue is I can't update rollbar config is there any way can I change or update rollbar configuration

I figure it out by setting up a new client with a new config, which should work if you want to change the configuration dynamically.
Here is the example

 public setEnvironment = (environment: string) => {
        this.config = new Configuration(this.ROLLBAR_ACCESS_TOKEN, {
            environment: environment
        });

        this.client = new Client(this.config);
    };