Skip to main content

Basic samples

These samples each demonstrate a single DocSpace Embed SDK mode or method in isolation. Use them as a quick reference before combining several calls into a real integration, like the ones in Advanced samples.

Not every SDK method has a dedicated sample yet. For the complete list, see the SDK reference for the init methods and the SDKInstance reference for the instance methods.

Authentication and session​

SampleDescription
Create password hashGenerate a password hash using the DocSpace JS SDK.
LoginLog in to DocSpace using the JS SDK with password hashing.
LogoutLog out a user from the DocSpace session using the JS SDK.
Get hash settingsRetrieve hash settings from the DocSpace frame using the JS SDK.
Get user infoRetrieve user information using the DocSpace JS SDK.

Frame initialization​

SampleDescription
Initialize frameInitialize a DocSpace frame in the mode set by the mode config field.
Initialize managerInitialize the DocSpace manager using the JS SDK.
Initialize editorOpen a document in the DocSpace editor using the JS SDK.
Initialize viewerEmbed a read-only document viewer using the JS SDK.
Initialize file selectorInitialize the DocSpace file selector using the JS SDK.
Initialize room selectorEmbed the room selection interface using the JS SDK.
Initialize systemInitialize the DocSpace system interface using the JS SDK.
Destroy frameRemove the embedded DocSpace iframe using the JS SDK.
Mark iframe as loadedMark the DocSpace iframe as loaded using the JS SDK.

Frame configuration and UI​

SampleDescription
Get configRetrieve the embedded frame configuration using the JS SDK.
Set configUpdate the embedded frame configuration using the JS SDK.
Set list viewChange the file list display mode using the JS SDK.
Open modalOpen a modal window in DocSpace using the JS SDK.
Get selectionRetrieve the current selection in DocSpace using the JS SDK.

Rooms and folders​

SampleDescription
Create roomCreate a new shared room using the DocSpace JS SDK.
Get roomsRetrieve available rooms using the DocSpace JS SDK.
Create folderCreate a folder in a DocSpace room using the JS SDK.
Get foldersRetrieve a list of folders from a room using the JS SDK.
Get folder infoRetrieve current folder information using the JS SDK.

Files​

SampleDescription
Create fileCreate a new file inside a DocSpace room using the JS SDK.
Get filesRetrieve a list of files from a room using the JS SDK.
Get files and folders listRetrieve files and folders from a room using the JS SDK.

Tags​

SampleDescription
Create tagCreate a custom tag in DocSpace using the JS SDK.
Add tags to roomAdd custom tags to a DocSpace room using the JS SDK.
Remove tags from roomRemove tags from a DocSpace room using the JS SDK.