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',
jwt: () => '{server_generated_jwt_token}',
stylesheet: '/styles/weavy-dropin.css'
});
The minimum required options to get started is to specify the url
to the weavy backend and a jwt
factory function to provide authentication. You must also provide a stylesheet, for instance through the stylesheet
option.
Option | Type | Description |
---|---|---|
apps |
array | 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() |
jwt * |
function | JSON Web Token (JWT) for authentication. |
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 history and deep links 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({
jwt: () => '{server_generated_jwt_token}'
});
Avoid putting the JWT directly in your default settings. Since a JWT is only valid for a limited time it might cause later requests to fail due to the token being expired.