Replies: 3 comments 1 reply
-
Thank you! This was super helpful! |
Beta Was this translation helpful? Give feedback.
-
Very glad it could help you. I have done it as there is only few examples in docs to show the use of excalidraw without react environment that I don't know and it is difficult to guess how to adapt from react to js. I don't use collaborative mode so unfortunately i can't help you on this side, but i remember to have read some times ago that you can't use collaborative mode on self-hosted version without react or something like that, but i'm not sure about that. All the properties you can change are described in the API docs here, maybe you will find what you need: |
Beta Was this translation helpful? Give feedback.
-
on the website I found this >> "The Ref support has been removed in v0.17.0 so if you are using refs, please update the integration to use the excalidrawAPI." How do intergrate the api with the new version? |
Beta Was this translation helpful? Give feedback.
-
Hello,
Here is a simple exemple of a standalone use of Excalidraw in html/js with backend for a php server.
At start, Excali is loaded with your custom library file, that should be named "libray.excalidrawlib" in the same folder as the script.
The main menu is changed to save & export on the server (instead of on the device).
It allows to save jsonfile.excalidraw or export png file with embbeded scene metadata, that allows to re-edit the scene later.
Add also some custom configuration of Excalidraw UI for example.
Usage:
Rename the "index.txt" in "index.php" and put this file in a folder of your server's document root, then call it from client with the syntax:
https://myhostname/pathto/index.php
or to re-edit a previous file, use query string: ?name=filename (file should be in the same folder as php script)
https://myhostname/pathto/index.php?name=image.png (or jsonfile.excalidraw)
The files are saved in the script directory to simplify this example.
For a png image, Excalidraw doesn't load the image itself, but reload the complete Scene, extracting it from the metadata embedded inside, so you can continue to modify it again.
index.txt
Beta Was this translation helpful? Give feedback.
All reactions