# Use fylr in Google docs via CI HUB

## Required

* Login to a fylr instance with permission to see some media content
  * This fylr needs to have the CI HUB capability in its fylr license. This is not part of all fylr licenses.
  * By default all fylr installations have the "OAuth client" named "ci-hub" configured, so this should not be an issue. However, during a fylr installation, this *could* theoretically be changed. If you have problems to connect CI HUB to fylr, consult the instances administrator.

## Setup

1. Open a Google document on <https://docs.google.com>
2. Open the `Extensions` menu and select `Get Add-ons`.
3. In this new dialog, search for `CI HUB` and install it. This will then happen automatically inside Google docs and not on your computer's local storage.
4. In the `Extensions` menu again, select `CI HUB Connector` and `Open`:<img src="https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-9eb35903c4830350040b2d8154c770c9b0bafd93%2Fimage.png?alt=media" alt="" data-size="original">
5. In the appearing panel (right hand side of the document) `Login` either with an existing CI HUB ID or `Register` for a free trial with CI HUB:

   <figure><img src="https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-5d86f3451f3bdc074b3a293c909290e1a57bd5b5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
6. After you logged in with your CI HUB ID, the side panel should change (you may have to re-open it).
7. In the CI HUB side panel, search for `fylr` and click the plus button (marked in green below):

   <figure><img src="https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-a7df4c2a94e6deb7b9115dae82d073a78d1c4316%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
8. Enter any fylr URL (where you have a login) and click `Login`: ![](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-1fd15db774e39d18e905b4841459684417b0d845%2Fimage.png?alt=media)
9. Log in to the appearing fylr login dialog with your *fylr* credentials.
10. Go back to the Google document. In the side panel e.g. click on the magnifying glass.
11. Then click on the magnifying class *below the first one*, to search for any asset in fylr. Both magnifying glasses are marked in green here:

    <figure><img src="https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-0b27491cdd1cabd67727fa1b1e87dccdbb7510f3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
12. If nothing is found, you may have to choose an Object Type in the drop down menu `Object Type`.
13. Click on one preview image once, then click on it a *2nd time* and **drag** it into your document before releasing the click.

Wait a few seconds for the transfer. (There is a spinning circle in the preview as long as CI HUB is working on it.)

### Known errors

* After clicking `Login` in Step 8:\ <mark style="color:red;">`Authorization failed`</mark>\ <mark style="color:red;">`Sorry, an unexpected error ocurred:`</mark>\ <mark style="color:red;">`TypeError: Cannot destructure property 'systemUrl' of '(intermediate value)' as it is undefined.`</mark>\
  \
  **When trying again a few minutes later, it worked.**
* When dragging an image from the CI HUB panel into the document:\ <mark style="color:red;">`Error: executePanelCommand failed: Exception: The image in the BlobSource could not be retrieved. Please make sure the image is valid.`</mark>\
  \
  Seems to be a kind of timeout with bigger images. **Did work when I tried it the 2nd time.**

## References

CI HUB official User Guide: <https://ci-hub.com/hubfs/CI%20HUB%20Connector%20User%20Guide%20v1.1.pdf>
