Weavy options

Typically, adding the Weavy client SDK to your application or website is enough to get you started. But you probably want to tweak the default options a bit to make your Weavy behave the way you want it to.


The default options for Weavy can be accessed through Weavy.defaults. These options are general for all Weavy instances and can be overridden with weavy.options when creating a new Weavy() instance.

Name Default Description
container : Element   Container where the widget should be placed. If no Element is provided, a <section> is created next to the <body>-element.
className : string   Additional classNames added to the widget.
https : string "adaptive" How to enforce https-links: "force" makes all urls https, "adaptive" enforces https if the calling site uses https and "default" makes no change.
init : boolean true Should the widget initialize automatically.
isMobile : boolean   Indicates if the browser is mobile. Defaults to the RegExp expression /iPhone|iPad|iPod|Android/i.test(navigator.userAgent)
plugins : object Plugin options, see Plugins for more details.
overlay : Element   Element to use for overlay purposes. May for instance use the overlay of another WeavyWidget instance.
url : string   URL to the Weavy-installation to connect to. It defaults to the url of your installation.

Using options

Specify options by passing an object with properties when constructing the Weavy instance. By default, the url option is set to your installation, but you can override it to point to a development server for instance.

    var weavy = new Weavy({
        url: '{weavyurl}'

Option presets

Using option presets makes it easy to apply a set of common options without having to specify each option separately. The presets can be merged with and overriden with additional options when you create a new Weavy() instance, since the contructor accepts multiple option sets.

Read more about presets in the Widget API

Accessing options

After creating a new Weavy() you can access all options through the weavy.options property.

var weavy = new Weavy();
var opts = weavy.options;