Get Started with Weavy client

Before using the Client SDK, you must setup a Weavy server environment (if you haven't already).

To obtain a copy of the client SDK you should point your browser to https://{weavyurl}/client to get to the client configurator in your weavy installation. Get the standard configuration.

Add the script

Add the script to your page and instantiate a new Weavy.

<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 a Files 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 through Single Sign On (SSO). You can read more about how to configure SSO here. If you want to try out the Weavy client without SSO, you can either go to https://{weavyurl} and sign in, or add the following to the script to trigger a sign in dialog.
<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" });

    // trigger sign in dialog. The recommended way to handle authentication is through SSO!
    weavy.authentication.signIn();
</script>