Drop-in UI options

Typically, adding the Drop-in UI 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.

Using options

Specify options by passing an object with properties when constructing the Weavy instance. You may pass several objects with options to the constructor that will be merged. This means you can have common options in one object and another object with specific options.

var weavy = new Weavy({
  url: 'https://weavy-server.example',
  tokenFactory: async (refresh) => '{server_provided_access_token}',
  stylesheet: '/styles/weavy-default.css'

The minimum required options to get started is to specify the url to the weavy backend and an async tokenFactory function to provide authentication from your backend.

Option Type Description
apps array DEPRECATED. List of app configurations. Same as using weavy.app({ ... })
css string General CSS overrides
id string A string identifying the weavy instance. This option is automatically set unless you specify it.
init boolean Indicates if weavy should init automatically. Set it to false to init weavy manually using weavy.init()
tokenFactory * function async function returning a string access token for authentication from the backend.
lang string Two-letter ISO 639-1 language code of preferred user interface language, e.g. en for English. When set, it must match one of the languages configured on your Weavy backend.
logging boolean Indicates if logging is turned on. Set to true to turn on all console logging.
plugins object Options for plugins. See for example history to configure deeplinks plugin.
stylesheet URL General weavy stylesheet for styling. May also be an array of multiple stylesheets.
tz string Timezone identifier, e.g. Pacific Standard Time. When specified, this setting overrides the timezone setting on a user's profile. The list of valid timezone identifiers can depend on the version and operating system of your Weavy server. To get an updated list you can run tzutil.exe /l
url * URL Url to your Weavy backend.

* Required options

Default options

The default options are stored in an object as a property called Weavy.defaults on the Weavy class. You can read or set these options before you create a new Weavy instance. The defaults will be applied on all Weavy instances unless other options are specified.

Weavy.defaults.url = '{weavyurl}';

var weavy = new Weavy({
  tokenFactory: async (refresh) => '{server_provided_access_token}'
Weavy Docs