Get Started with Weavy client
To obtain a copy of the Weavy javascript library you should point your browser to https://{weavyurl}/client
to get to the client configurator in your weavy installation.
Add the script
Add the script to your page and instantiate a new Weavy instance.
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://{weavyurl}/javascript/weavy.min.js"></script>
<script>
var weavy = new Weavy();
</script>
Add a container
Weavy will be inserted on your page exactly where you want it to be. Add a new placeholder element as shown in the example below.
<div id="weavy-container" style="height:500px"></div>
Add an app
Weavy comes with several built in apps. One of them is the Files app, an app for file storage and document collaboration. Every app needs to be associated with a Space. You can think of the Space as a container for one or more apps.
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://{weavyurl}/javascript/weavy.min.js"></script>
<script>
var weavy = new Weavy();
var space = weavy.space({ key: "getting-started", name: "Getting Started Space" });
space.app({ key: "my-files", name: "Files", container: "#weavy-container" });
</script>
Every space and app needs at least a key
when created. The key
is how you control what should be displayed from Weavy in your app.
Think of it as an association between the context in your app and what content to show from Weavy. Let's say you have a customer page showing Customer X. You probably have an internal id or guid of that customer in your app. Use that unique id when creating the key
for spaces and apps in Weavy.
Try it out!
You should now see a Files app showing up in the weavy-container
element.
Not seeing anything?
That's probably because you're not signed in to Weavy. The recommended way to handle authentication is with Single Sign-On (SSO).
If you want to try out the Weavy client without SSO, you can either go to https://{weavyurl}
and sign in, or you can open a sign in form directly from the client by modifying you init script as seen below:
<script>
var weavy = new Weavy();
var space = weavy.space({ key: "getting-started", name: "Getting Started Space" });
space.app({ key: "my-files", name: "Files", container: "#weavy-container" });
// open sign in form, for production use we recommend configuring SSO instead!
weavy.authentication.signIn();
</script>