# Re-frame runtime configuration

**URL:** https://clojureverse.org/t/re-frame-runtime-configuration/7425
**Category:** How to?
**Created:** [April 1, 2021, 10:14am UTC](https://clojureverse.org/t/re-frame-runtime-configuration/7425 "2021-04-01T10:14:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Pascal\_Dutilleul](https://clojureverse.org/user_avatar/clojureverse.org/pascal_dutilleul/32/3420_2.png) [@Pascal\_Dutilleul](https://clojureverse.org/u/Pascal_Dutilleul)
#### Post date: [April 1, 2021, 10:14am UTC](https://clojureverse.org/t/re-frame-runtime-configuration/7425/1 "2021-04-01T10:14:31Z")

</div>

Hi all,  
I created a spa in re-frame that dynamically generates a wizard. The layout of the wizard is currently defined in app-db. But I want to use the same compiled code for different wizards. So I want to pass somehow that wizard configuration at runtime to the spa.  
With this, I hand the compiled js over to the python flask team. And they will be able to generate all the wizards they want, just by changing the configuration, without a need to recompile the clojurescript code.  
Any suggestions, ideas on how to implement this?  
Thanks in advance.

---

<div class="post-metadata">

### Author: ![Phill](https://clojureverse.org/letter_avatar_proxy/v4/letter/p/779978/32.png) [@Phill](https://clojureverse.org/u/Phill)
#### Post date: [April 1, 2021, 10:27am UTC](https://clojureverse.org/t/re-frame-runtime-configuration/7425/2 "2021-04-01T10:27:30Z")

</div>

An SPA might initialize its app-db from an online web service, from random numbers, or from things it finds in the browser environment - such as the URL and the JS variables. An example of the latter is an HTML page that has a tiny script tag that sets a configuration variable before the script tag that loads the SPA.

---

<div class="post-metadata">

### Author: ![Kah0ona](https://clojureverse.org/user_avatar/clojureverse.org/kah0ona/32/3056_2.png) [@Kah0ona](https://clojureverse.org/u/Kah0ona)
#### Post date: [April 4, 2021, 10:29am UTC](https://clojureverse.org/t/re-frame-runtime-configuration/7425/3 "2021-04-04T10:29:46Z")

</div>

If I understand your question correctly:…

An approach would be to store the widget configuration as normal data.

I had the same requirement. So you could make something like:

```auto
(def config1 
  [{:step 1 :type ,,, :content ,,, :other ,,, :data} 
   {:step 2 :type ,,, :content ,,,, :other ,,,, :date}])

```

And then basically in Re-frame create a ‘wizard engine’. Ie, handlers for ‘next’ and ‘prev’, subscriptions for what current step is active, etc.

All the configuration can be stored somewhere external and passed in.

you could also leverage multi-methods to render config data based on :type for example.

---

<div class="post-metadata">

### Author: ![system](https://clojureverse.org/uploads/default/original/2X/5/51079bf9e4b7d9466242c06cf1e43b9f8bd6da14.png) [@system](https://clojureverse.org/u/system)
#### Post date: [October 3, 2021, 10:30pm UTC](https://clojureverse.org/t/re-frame-runtime-configuration/7425/4 "2021-10-03T22:30:01Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
