Install the SDK
Choose an asset
Create one picker instance, then callopen() in response to a user action.
pub-) token and
the company’s shop name. Do not put a company or partner token in client-side
code. See Authentication for token guidance.
Configure the picker
Use these options to shape the selection workflow.Select sources
The SDK supports five source identifiers:local_file_systemurldam_libraryunsplashai_generate
Configure transformations
All available transformation tools are enabled by default. Set individual tools tofalse when a workflow should offer fewer choices.
transformations: false for files that should be returned without an
editing step.
Use the selection result
onSelect receives a result with two views of the selection:
result.assetis the first selected asset.result.assetsis every selected asset and is always an array.
url, assetCode, name, and
mimeType. It can also include dimensions, file size, a variant identifier,
and a numeric DAM identifier.
assetCode with the URL when you need a stable DAM identity as well
as a renderable asset location.
Open an existing asset for editing
Passasset to skip source selection and open one existing asset in the
transformation editor. You can identify it by its DAM asset code.
Use the React hook
Import React bindings from@fluid-app/dam-picker/react. The hook returns an
open() function and the current open state.
DamPickerModal from the same React entry
point.
Clean up an instance
Calldestroy() when the component or view that owns a vanilla JavaScript
picker is removed.