If you want to use any third parties for your assets loading, it is recommended to overwrite the side panel with your own UI and your own API requests. However, you can replace API calls for several built-in functions
import { setAPI } from 'polotno/config';
// remember to not expose unsplash API keys in the client side
// so it is better to have your own proxy server for that
setAPI('unsplashList', ({ query, page = 1 }) => {
return `https://example.com/unsplash?query=${query}&page=${page}`;
});
// trigger download for selected image
setAPI('unsplashDownload', (id) => {
return `https://example.com/unsplash?id=${id}`;
});
// replace URL to get list of nounproject icons (used in elements side panel)
// you may need to have your own backend for that
setAPI('nounProjectList', ({ query, page = 1 }) => {
return `https://example.com/nounProject?query=${query}&page=${page}`;
});
// replace URL to download selected icons from nounproject API.
setAPI('nounProjectDownload', (id) => {
return `https://example.com/download-nounProject?uuid=${id}`;
});
News, updates and promos – be the first to get 'em
News, updates and promos – be the first to get 'em
Copyright © 2024 Polotno