Initialization
Once a
codox
instance has been created, you should initialize thecodox
instance with app specific configurations. The general structure of the config
JSON is as follows:Key | | Value |
app | (required) | string |
docId | (required) | string |
apiKey | (required) | string |
user | (required) | object |
editor | (required) | object |
autoStart | (optional) | boolean |
avatar | (optional) | object |
showUI | (optional) | boolean |
showCursor | (optional) | boolean |
cursorAlwaysOn | (optional) | boolean |
showPointer | (optional) | boolean |
pointers | (optional) | object |
hooks | (optional) | object |
username | (deprecated) | string |
string
The static string value
'froala', 'quill', or 'tinymce'
string
A unique identifier for the document. In a content management service, this could for example be the resource identifier for the document.
The uniqueness of the identifier is essential to avoid collisions between one co-editing session and another. In particular, if you are running multiple subdomains for user subscriptions, make sure the docId is "namespaced" and unique across all the subdomains .
string
Object
This user field allows you to attach app specific meta-data to the user.
Key | | Value |
name | (optional) | string |
email | (optional) | string |
avatar | (optional) | url |
id | (optional) | string |
color | (optional) | string |
The value of the
avatar
field is a link to an image resource. If avatar
has a value specified, it will override the default solid background avatar implementation. The value of
color
can be any valid css color property value (e.g., 'red'
, '#00ff00'
, 'rgb(0, 0, 255)'
) . Object
A reference to an editor instance for which the co-editing session should start in. For Froala and Quill integrations, assign
editor
the reference to the editor object. For TinyMCE, the plugin will pass in the editor object reference automatically. Each
codox
instance is bound to a single editor
instance. If the editor is destroyed and recreated as part of some UI framework lifecycle events, then a new codox
object should be created with the new editor
instance.boolean
Set to
true
to start co-editing immediately on call toinit(config)
. Set to false
to initialize but delay the start to co-editing (see the codox.start()
client API). Default to
true
.object
This is an optional configuration parameter that determines the position of the avatars relative to the editor window.
Key | | Value |
left | (optional) | boolean |
vertical | (optional) | boolean |
The avatars are placed horizontally by the top-right corner of the editor window by default.
left
and vertical
both default to false
boolean
Set to
true
to show avatars for online users. Set to false
to hide the avatars. Defaults to
true
.boolean
Set to
true
, to display cursor positions and selections for remote co-editing users. Set to false
to hide cursor positions and selections. Defaults to
true
.boolean
Set to
true
to always show remote users' caret with username.Defaults to
false
boolean
Set
true
, to display pointer positions and click events of remote co-editing users. Set false
to hide pointers.Defaults
false
.object
This is an optional parameter that controls the rendering of remote pointers. Static string values: 'arrow', 'hand', 'pointer', 'pointerSolid'.
Key | | Value |
shape | (optional) | string |
object
string
The name of the user joining the co-editing session. For a content management service, this should be set for each logged-in user based on their credentials. This name will be displayed during real-time co-editing sessions.
username
is deprecated and will be removed in the next major release (v2). Please use the user
meta-data field.Please refer to individual editor integration instructions on how to specify the values of these parameters.
Last modified 2yr ago