Orange Logic Content Browser SDK
Config
Output

Properties

Callbacks
  • onAssetSelected

    A function that will be called when an asset is selected. The function will receive an array of selected assets.

  • onAppAuthUrlCopied

    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.

  • onImageSelected (deprecated)

    A function that will be called when an image is selected. This is deprecated, use onAssetSelected instead.

  • onError

    A function that will be called when an error occurs. The function will receive an error message and the error object.

  • onClose

    A function that will be called when the content browser is closed.

  • onRequestToken

    A function that will be called when a token is needed. Should return a Promise that resolves to an object containing:

    • token (required): The authentication token string
    • siteUrl (optional): The site URL to use with the token

    This function is called:

    • During initial authentication when the SDK is opened
    • When the current token expires (401 error)
    • Before making API calls that require authentication

    Note: When this callback is provided, the SDK uses Bearer token authentication headers instead of query parameters.

  • onAssetAction

    A function that will be called when an action is performed on an asset.

  • onConnectClicked

    A function that will be called when the Connect button is clicked.

  • onSiteUrlChanged

    A function that will be called when the site URL is changed, useful for invalidating browser cache when change sites.

  • onTokenChanged

    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:

    • Initial authentication is successful
    • Token is refreshed after expiration
    • User logs in with new credentials

  • customStorage

    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:

    • get(key: string): Promise<string | null> - Retrieve data from storage by key
    • set(key: string, value: string, ttl?: number): void - Store data with the given key, with optional TTL (time-to-live) in seconds
    • delete(key: string): void - Remove data from storage by key

    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.

Setup Configurations
  • publicApplicationName (default blank)

    The public name of the DAM to display in the login screen.

  • pluginName (default "Orange Logic Content Browser")

    The name of the plugin to display in the login screen.

  • containerId

    The id of the container element to attach the content browser. If not provided, the content browser will open in a popup.

  • baseUrl

    The default base URL to pre-fill in the content browser.

  • displayInfo

    An object to configure the display of the asset information. The object has the following properties:

    • title (default true)
    • dimension (default true)
    • fileSize (default false)
    • tags (default false)
  • extraFields

    An array of extra fields to get from the assets. The fields are in the format of "coreField.FieldName" or "document.FieldName".

  • ctaText (default "Insert")

    The text to display on the insert button.

  • availableDocTypes

    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:

    • DO_DOCUMENTS.Image_DbBO.*
    • DO_DOCUMENTS.Audio_DbBO.*
    • DO_DOCUMENTS.Multimedia_DbBO.*
    • DO_DOCUMENTS.Video_DbBO.*

    Note: Asset type names are case-sensitive.

  • availableRepresentativeSubtypes

    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.

  • defaultGridView

    The default grid view when showing assets (default medium). Available value: small, medium, large

  • lastLocationMode (default true)

    A boolean to enable the last location mode. When enabled, the content browser opens the last selected folder on load.

  • persistMode (default false)

    A boolean to enable the persist mode. When enabled, the content browser will not close after selecting an asset.

  • allowTracking (default true)

    A boolean to enable tracking. When enabled, tracking parameters will be added to asset URLs.

  • allowProxy (default true)

    A boolean to allow the user to select proxy images.

  • allowFavorites (default false)

    A boolean to allow the user to select favorites.

  • allowPin (default false)

    A boolean to allow the user to pin the browser.

  • allowLogout (default true)

    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.

  • allowedFolders

    An array of allowed folder RecordIDs to be selected. If not provided, all folders will be allowed.

  • allowedExtensions

    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.

  • showCollections (default false)

    A boolean to show collections in the content browser.

  • showFavoriteFolder (default false)

    A boolean to show the favorite folder in the content browser.

  • showVersions (default false)

    A boolean to show asset versions in the content browser.

  • loadExternalFonts (default true)

    A boolean to toggle between loading external fonts from direct links and from internal CSS file.

  • useSession

    The session id to use for the content browser. Try logging out and in whenever you change the session.