Please give a brief summary of your issue:
First of all I want to understand if it is still needed to upload the folder for each site when you are deploying the web part/ extension and so on or I can leave it inside the web part project, just bundle it and it will work.
I mean this steps:
3. In the Document Library of your SharePoint site, create a “Webviewer” folder and create another child folder “js” inside the “Webviewer” folder.
4. Upload the lib folder extracted from the WebViewer.zip to the js folder.
The webviewer lib folder should now be available from the url: https://.sharepoint.com/sites//Shared Documents/Webviewer/js/lib.
Second question is if I want to deploy web part for example how can I make it easily usable on different tenants and sites without using .env file ? Cause I’m not completely understand how to make it.
Bundling the project with the lib folder inside should be sufficient.
If you are bundling it in an app and not including the lib folder the files, then https://.sharepoint.com/sites//Shared Documents/Webviewer/js/lib
aka the domain that is hosting WebViewer wont have the files.
Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer Apryse Software Inc.
Also wanted to clarify what is a correct way, to provide config.js file ? Cause for now I receive problem that viewer is on a different domain when make it through azure cdn, and it gives me suggestion to create config.js and put code in there. I tried to put it as a separate blob in my azure storage, but after I provide config field to Webviewer class, after “then” “instance” is undefined
Since you have the path option specified on another domain, you will need to edit the lib/ui/configorigin.txt file to whitelist your app’s domain(s).
See this link for more info: Apryse Documentation | Documentation
It is also worth noting that we encourage config files to first be added within the project files and passed in as a relative URL, relative to the HTML file.
If I understand correctly, this is your current issue:
You would like to follow this guide to move your lib/core files on another domain
The UI will remain will not be moved and will exist in the project’s current domain
You are specifically concerned with the uiPath option in the WebViewer constructor
Let me know if I missed anything or if I misunderstood.
I noticed that your current uiPath does not have a .aspx extension.
As mentioned in the sample project we provide, uiPath must lead to the entry point of the webviewer ui, and for sharepoint it would have a .aspx extension.
Was the ‘./ui/index.aspx’ value not working for you?
Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer Apryse Software Inc.
Move only core library and leave ui in sharepoint.
Right now I understand that I need the first approach (I mean * Move both ui and core folder to Azure storage). But I have problems in implementing it.
When i move both folder to Azure storage I do following things:
I add config.js file in the same folder where index.aspx file (i mean index.aspx file that is inside ui folder, that is stored in my azure storage account)
Looking at the config option in your WebViewer constructor, you mentioned it is store in your azure storage account.
Usually that option is passed in a relative url, relative to the index.html file (same folder as where your constructor is). Would you be able to move it there and use a relative url in your WebViewer construction options and see if that works?
Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer Apryse Software Inc.