The client configuration is a JSON object loaded before Kiwi IRC starts. If a config cannot be found or an error loading it occurs, an error message will be displayed on the page and the client will not start.
Loading the config file
A config can be loaded from a number of places depending on which best suits your environment. If you have an existing website in PHP, Ruby, NodeJS, Java, or any other dynamic language, you can even generate the config on the fly to better integrate the client into your website.
The following locations are checked in order.
Use a javascript function
The javascript function window.kiwiConfig
is checked before anything else. If it exists, it will be called and the return value should be the config object - exactly the same as the config.json structure.
Specify a URL location
You can specify the URL to your JSON config file in a meta tag named kiwiconfig
on the client page (index.html). Example: <meta name="kiwiconfig" content="http://example.com/path/to/config.json">
JSON string directly in the page
If generating the JSON config yourself then you can include it directly into the client page (index.html) in a script tag named kiwiconfig
. As an added bonus this will save a HTTP request making it faster to load.
Example:
<script name="kiwiconfig">
{"startupScreen": "customServer", "startupOptions": { "server": "irc.freenode.net", "port": 6697, "tls": true, "direct": false, "nick": "" }}
</script>
Plain config.json
Loads the JSON file from static/config.json