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.
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.
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.
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">
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>
Loads the JSON file from static/config.json
Config options are in JSON format using a plain object. Example: {"option1": "value", "option2": true}
.
You may either use nested JSON objects or simple dotted notation. These two config files are equivalent:
{
"startupOptions": {
"server": "irc.example.com"
}
}
{
"startupOptions.server": "irc.example.com"
}
Dotted notation is parsed after the config is loaded. This makes it easy for configurations that are generated on the fly and overwrite a default configuration.
This means that this:
{
"startupOptions": {
"server": "irc.example.com"
},
"startupOptions.server": "irc.otherserver.com"
}
ends up being this:
{
"startupOptions": {
"server": "irc.otherserver.com"
}
}
A full listing of config options can be found [[here|Configuration-Options]]
Example: "My IRC network"
The title of the webpage. This appears in the browser tab and bookmark managers when bookmarked.
Example: "customServer"
The screen that is first shown. More information on this can be found [[here|startup-screens]]
Example: "http://example.com/config.json"
The URL to your kiwi server. More information on this can be found [[here|kiwi-server]]
Example: true
or false
If set to true
, Kiwi IRC will only be allowed to connect to the network that you specify.
The themes listed here will be available in the client. There must be at least one theme here. The URL should only point to the folder of your theme that contains your theme.css
file.
Example:
[
{ "name": "Default", "url": "static/themes/default/" },
{ "name": "Theme2", "url": "static/themes/theme2/" },
{ "name": "Other Theme", "url": "http://example.com/kiwi_theme/" }
]
If you add a theme named custom
, this will allow the user to temporarily set their own theme URL. Handy for designers and trying out different themes.
Example: "default"
The name of the default theme to use. This name must be in the available themes list.
Example: "embedly API key"
Kiwi IRC uses the embedly service to show a preview of links directly within the client. If you have an embedly API key to custom the previews or remove its branding, you can enter your API key here.
Object / configuration for the first screen of the client. Eg. the connection screen
Example: "irc.freenode.net"
This will be the default IRC server the client will connect to. May be left empty to force the user to enter a server.
Example: 6667
This will be the default port for the IRC server the client will connect to. By default it uses 6667, or 6697 if using SSL/TLS.
Example: true
or false
If set to true
, Kiwi IRC will enable SSL/TLS by default for the IRC server connection. If set to false
, an un-secure plain-text connection will be used.
Example: "mypassword"
This is the password sent to the IRC server using PASS
.
Example: true
or false
Kiwi IRC supports connecting directly to IRC servers that support websockets. Setting this to true
will connect directly instead of using a Kiwi server. (Note: this may be more unstable depending on the users browser, network, anti virus, proxies, amongst other situations)
Example: "#channel,#channel2"
This will be the default channel that the client will automatically join.
Example: "a_nick"
This will be the default nick that the client will use. A ?
character may be used to specify a random number to help reduce conflicting nicks.
Example: true
or false
If using the welcome
startup screen, this will tell the client to automatically connect with the connection settings you have given.
Example: "kiwi-state"
The state key is the name for the user session. The default is "kiwi-state". Users IRC connections and channels will be remembered in their browser for the next time they open the webpage. If set to an empty string (""
) then nothing will be remembered.
Example: true
or false
When the user session is saved via startupOptions.state_key
only the user settings are saved. Set this option to true to also save the users networks and channels.
Example: "Hello!"
The header that is shown on the startup page. HTML may also be used here.
Example: "Start"
The text that is shown on the connect button on the startup page. HTML may also be used here.
Example: "Welcome to my network! Please visit my <a href='/home' target='_blank'>homepage</a> for help."
The HTML content that is shown on the right side of the startup page.
Example: "/info_background.jpg"
The background image for the right side of the startup page.