@orangelogic/orange-dam-content-browser-sdk 2.3.5 → 2.3.6-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,11 +48,66 @@ yarn start
48
48
  ```
49
49
  yarn build
50
50
  ```
51
- - use the 2 files `build\static\js\ContentBrowserSDK.min.js` and `build\static\css\ContentBrowserSDK.min.css` in your other projects
51
+ - use the 2 files `build/OrangeDAMContentBrowserSDK.min.js` and `build/OrangeDAMContentBrowserSDK.min.css` in your other projects
52
52
 
53
53
  # More guide
54
54
  For detail guides on usage check out the [Orange Logic Developer Portal](https://developer.orangelogic.com/docs/generic-asset-browser)
55
55
 
56
+ ## Reuse the Current Cortex Login
57
+
58
+ For an HTML page served by the Cortex site, enable `useSiteSession` to use the
59
+ browser's existing site login. No site URL, token callback, or SDK login is needed.
60
+ Load `build/OrangeDAMContentBrowserSDK.min.js` and
61
+ `build/OrangeDAMContentBrowserSDK.min.css`, then open the picker with:
62
+
63
+ ```html
64
+ <div id="asset-picker" style="height: 600px"></div>
65
+ <script>
66
+ OrangeDAMContentBrowser.open({
67
+ containerId: 'asset-picker',
68
+ useSiteSession: true,
69
+ onAssetSelected: (assets) => console.log(assets),
70
+ });
71
+ </script>
72
+ ```
73
+
74
+ The site defaults to `window.location.origin`. For a Cortex installation under a
75
+ virtual directory, supply a `baseUrl` on that same origin. The HTML page (or iframe
76
+ document) must run on the Cortex origin; loading the SDK script from Cortex into a
77
+ page on another domain does not share its login.
78
+
79
+ This mode uses cookies managed by the browser and ignores saved SDK credentials,
80
+ `onRequestToken`, and `useSession`. It hides SDK logout and does not launch SDK
81
+ authentication when the site session expires. Sign in through the Cortex site and
82
+ reopen the picker to resume. Omit `useSiteSession` to retain the existing SDK
83
+ authentication flow.
84
+
85
+ ## Pick Without Formats (`simplePick`)
86
+
87
+ Set `simplePick: true` when the host only needs the user to choose an asset. The SDK
88
+ skips the available-proxies lookup and the transformation request that normally runs
89
+ when an asset is confirmed, so picking costs one fewer round trip each way:
90
+
91
+ ```html
92
+ <script>
93
+ OrangeDAMContentBrowser.open({
94
+ containerId: 'asset-picker',
95
+ simplePick: true,
96
+ onAssetSelected: (assets) => console.log(assets),
97
+ });
98
+ </script>
99
+ ```
100
+
101
+ The preview popup still opens with the asset's metadata, but shows only the image
102
+ (`CoreField.LargeSizePreview`, already returned by the content request that fills the
103
+ grid) and a single confirm button -- no proxy selector and no custom-format section.
104
+ Confirming emits the asset straight to `onAssetSelected`.
105
+
106
+ `simplePick` implies `allowProxy: false`; passing both is not an error, the proxy
107
+ setting is simply ignored. Because no GetAssetLink request is made, only the computed
108
+ `extraFields` (`ScrubUrl` and `AllowATSLink`) are returned in this mode -- request any
109
+ other field with `simplePick` off.
110
+
56
111
  # Change Log
57
112
  * March 24, 2026 - v2.2.3
58
113
  * Supports displaying asset thumbnails according to the selected format (https://link.orangelogic.com/Tasks/420YSB)
@@ -28,6 +28,7 @@ export type GlobalConfigContextType = {
28
28
  allowLogout?: boolean;
29
29
  allowTracking: boolean;
30
30
  allowProxy: boolean;
31
+ simplePick: boolean;
31
32
  allowFavorites: boolean;
32
33
  allowPin: boolean;
33
34
  allowFormatDialogPin?: boolean;