Api call happening on using registerCallback images
Why api call is happening to https://api.tools.unlayer.com/v1/image?url=customImageUrl when using custom image library.
Is there any way to disable this call happening to unlayer server.
We use it this editor for private mailers and don't want anything to go to any external service, currently unlayer editor is making call for images.
@adeelraza @lucasbesen @umairsiddique Is there any way we can disable these proxy calls happening because right now we are using custom image chooser where we are passing the image url back to done callback on registerCallback('images')
Currently it is looking like things are unnecessarily making api call when they are not being used as well. or Is it a bug. Please help.
I'm looking for the same issue Is there any way we can upload images to our domain and giver URL here?
selectImage callback will place you in direct control of the image uploading and management. https://docs.unlayer.com/docs/custom-image-library
unlayer.registerCallback('selectImage', function (data, done) { // Open your image library // Once a user picks an image, call the done function with URL done({ url: "IMAGE URL GOES HERE" }); });
to use your own storage you can use the "image" callback.
const onReady = async () => {
emailEditorRef?.current?.registerCallback(
"image",
async function (file, done) {
var dataa = new FormData();
dataa.append("file", file.attachments[0]);
done({ progress: 0 });
axios
.post(`/files/v1`, dataa, {
headers: {
"Content-Type": "multipart/form-data",
},
})
.then(({ data }) => done({ progress: 100, url: data?.url }));
}
);
.....
<EmailEditor ref={emailEditorRef} onReady={() => onReady()} />
even when using the image callback for custom image handling, I observe that a request is still made to:
https://api.tools.unlayer.com/v1/image?url=...
This call happens when you try to edit the image. This is because the image editor in browser does not allow CORS URLs so Unlayer has to proxy the image from our servers.
Do you want to disable the image editor in the builder?
Are you still getting the issue @greedysiru ? I am getting this issue. It was working fine, but now I noticed that the request is being made to unlayer.
to use your own storage you can use the "image" callback.
const onReady = async () => {
emailEditorRef?.current?.registerCallback( "image", async function (file, done) { var dataa = new FormData(); dataa.append("file", file.attachments[0]); done({ progress: 0 }); axios .post(`/files/v1`, dataa, { headers: { "Content-Type": "multipart/form-data", }, }) .then(({ data }) => done({ progress: 100, url: data?.url })); } );.....
<EmailEditor ref={emailEditorRef} onReady={() => onReady()} />
As of 2025 this callback doesn't work, anyone knows a workaround?
Edit: I've just found out that it's no longer supported on the free plan. Time to move on.
As of 2025 this callback doesn't work, anyone knows a workaround?
Edit: I've just found out that it's no longer supported on the free plan. Time to move on.
@Valkhan I cannot seem to find anywhere in the documentation when it mentions that is is no longer supported on the free plan, I was hoping you'd be able to give me some information as to where I can find that pls.
but honestly, why would that be the case? does it cost them more with the callback or something? this is truly disappointing
hopefully it is just a temporary issue and they change it back or something.
As of 2025 this callback doesn't work, anyone knows a workaround? Edit: I've just found out that it's no longer supported on the free plan. Time to move on.
@Valkhan I cannot seem to find anywhere in the documentation when it mentions that is is no longer supported on the free plan, I was hoping you'd be able to give me some information as to where I can find that pls.
but honestly, why would that be the case? does it cost them more with the callback or something? this is truly disappointing
hopefully it is just a temporary issue and they change it back or something.
They recently released the new version and by default the stable version is used. The new version seems to have an issue. I followed https://docs.unlayer.com/builder/version-management#version-locking to specify the old version I was using, and it started working as expected. I would explore more in new version before switching back to the stable version. Passing the project id may fix the issue in new version, but I have not tried it.
As of 2025 this callback doesn't work, anyone knows a workaround? Edit: I've just found out that it's no longer supported on the free plan. Time to move on.
@Valkhan I cannot seem to find anywhere in the documentation when it mentions that is is no longer supported on the free plan, I was hoping you'd be able to give me some information as to where I can find that pls.
but honestly, why would that be the case? does it cost them more with the callback or something? this is truly disappointing
hopefully it is just a temporary issue and they change it back or something.
Go to your unlayer console and try upgrading your free plan, you'll get the message:
You’re missing out on many powerful features. Upgrade today to get:
- Unlimited Users
- Roles & Permissions
- Custom Tools
- Custom Blocks
- Custom File Storage <<<
- Collaborators
- Cloud API
- Priority Support
I Don't think it costs more, but surely they earn less, in terms of costs using their AWS account will add costs, but using a custom file storage they can no longer measure how much images and traffic you'll get from your e-mails since they are providing you a "free" editor only, and surely that's not what they want, they need data to offer you a "better" paid plan.
This is the config I use:
{
version: '1.157.0',
appearance: {
theme: "modern_light"
},
env: {
API_V1_BASE_URL: "http://127.0.0.1",
API_V2_BASE_URL: "http://127.0.0.1",
EVENTS_API_BASE_URL: "http://127.0.0.1",
TOOLS_API_V1_BASE_URL: "http://127.0.0.1",
TOOLS_CDN_BASE_URL: "http://127.0.0.1",
CONSOLE_BASE_URL: "http://127.0.0.1"
}
}
using this all old features work and there are no requests to unlayer.com. There is still a failed http://127.0.0.1/editor/auth request, but no other requests are made (e.g. for autosave or image uploads). Also there's no "powered by" notice on the bottom right.
This is the config I use:
{ version: '1.157.0', appearance: { theme: "modern_light" }, env: { API_V1_BASE_URL: "http://127.0.0.1", API_V2_BASE_URL: "http://127.0.0.1", EVENTS_API_BASE_URL: "http://127.0.0.1", TOOLS_API_V1_BASE_URL: "http://127.0.0.1", TOOLS_CDN_BASE_URL: "http://127.0.0.1", CONSOLE_BASE_URL: "http://127.0.0.1" } } using this all old features work and there are no requests to unlayer.com. There is still a failed
http://127.0.0.1/editor/authrequest, but no other requests are made (e.g. for autosave or image uploads). Also there's no "powered by" notice on the bottom right.
Thank u, it works, It just calls api registered and doesn't call unlayer apis
will the 1.157.0 version supported in future too