A function that will be called when an asset is selected. The function will receive an array of selected assets.
An async function that will be called when the app auth URL is copied. The function will receive the app auth URL as a parameter. This is useful for customizing the copy behavior.
A function that will be called when an image is selected. This is deprecated, use onAssetSelected instead.
A function that will be called when an error occurs. The function will receive an error message and the error object.
A function that will be called when the content browser is closed.
A function that will be called when a token is needed. Should return a Promise that resolves to an object containing:
This function is called:
Note: When this callback is provided, the SDK uses Bearer token authentication headers instead of query parameters.
A function that will be called when an action is performed on an asset.
A function that will be called when the Connect button is clicked.
A function that will be called when the site URL is changed, useful for invalidating browser cache when change sites.
A function that will be called whenever the authentication token is updated. Receives the new access token as a parameter. This is useful for keeping external integrations synchronized with the SDK's authentication state.
This callback is triggered when:
An object that provides custom storage implementation for the SDK. This allows integrations to control how the SDK stores and retrieves persistent data.
The customStorage object must implement the following interface:
Example implementation:
customStorage: {
get: async (key) => localStorage.getItem(key),
set: (key, value) => localStorage.setItem(key, value),
delete: (key) => localStorage.removeItem(key)
}
Note: If not provided or missing one of the action, the SDK will use its default storage mechanism.
The public name of the DAM to display in the login screen.
The name of the plugin to display in the login screen.
The id of the container element to attach the content browser. If not provided, the content browser will open in a popup.
The default base URL to pre-fill in the content browser.
An object to configure the display of the asset information. The object has the following properties:
An array of extra fields to get from the assets. The fields are in the format of "coreField.FieldName" or "document.FieldName".
The text to display on the insert button.
An array of Orange Logic asset types used to filter the displayed assets. If not provided, all asset types will be shown.
Currently, supported types include:
Note: Asset type names are case-sensitive.
An array of supported Orange Logic subtypes to allow inserting representative image. If not provided, all subtypes will be supported.
E.g. Standard Image, Standard Video, Standard Audio, Other,...Note: The subtypes are case-sensitive.
The default grid view when showing assets (default medium). Available value: small, medium, large
A boolean to enable the last location mode. When enabled, the content browser opens the last selected folder on load.
A boolean to enable the persist mode. When enabled, the content browser will not close after selecting an asset.
A boolean to enable tracking. When enabled, tracking parameters will be added to asset URLs.
A boolean to allow the user to select proxy images.
A boolean to allow the user to select favorites.
A boolean to allow the user to pin the browser.
A boolean to allow the user to logout from the content browser. When disabled, the user will not be able to logout from the content browser.
An array of allowed folder RecordIDs to be selected. If not provided, all folders will be allowed.
An array of allowed file extensions to be selected. This will affect the list of available proxies and list of output extension to be selected of the custom format. If none are specified, it will allow all available file extensions.
Example list format: ['jpg', 'png', 'gif', 'mp4', 'webm']
Note: This will not affect or filter the search results.A boolean to show collections in the content browser.
A boolean to show the favorite folder in the content browser.
A boolean to show asset versions in the content browser.
A boolean to toggle between loading external fonts from direct links and from internal CSS file.
The session id to use for the content browser. Try logging out and in whenever you change the session.