Context component

<wy-context> | WyContext

The context component provides an alternative way of initializing the Weavy UIKit that does not require creating an instance of the Weavy class. This can be useful in some scenarios, for instance in low-code and no-code platforms with limited javascript functionality.

Importing

If you installed the UIKit with npm you can use the following snippet to import the component into your project. Otherwise, if you installed the UIKit as a <script> you can ignore this section.

import { WyContext } from "@weavy/uikit-web";

Examples

The context component can be used by itself as seen in the example below.

<wy-context
  url="{WEAVY-URL}"
  tokenUrl="https://example.com/myapp/token"
></wy-context>
...
<h1>Messenger with standard weavy configuration</h1>
<wy-messenger></wy-messenger>

It can also be used as a context provider where you place other Weavy components as children of the context provider.

<wy-context url="{WEAVY-URL}" tokenUrl="https://example.com/myapp/token">
  <h1>Messenger inside a weavy context provider</h1>
  <wy-messenger></wy-messenger>
</wy-context>

Properties

Property Type Description
url* string, URL URL to your Weavy environment.
tokenUrl* string, URL URL to token endpoint.

Learn more about attributes and properties.

Ask AI
Support

To access live chat with our developer success team you need a Weavy account.

Sign in or create a Weavy account