Edit in GitHubLog an issue

cloud

Since: XD 14

The cloud module lets you get information about shared prototypes and design specs.

Example

Copied to your clipboard
1// Get prototypes data
2const cloud = require("cloud");
3var sharedArtifacts = cloud.getSharedArtifacts();
4var prototypes = sharedArtifacts.filter(
5 (artifact) => artifact.type === cloud.ArtifactType.PROTOTYPE
6);
7prototypes.forEach((artifact) => {
8 console.log("Prototype URL: ", artifact.url);
9});

Example

Copied to your clipboard
1// Get design specs data
2const cloud = require("cloud");
3var sharedArtifacts = cloud.getSharedArtifacts();
4var specs = sharedArtifacts.filter(
5 (artifact) => artifact.type === cloud.ArtifactType.SPECS
6);
7specs.forEach((artifact) => {
8 console.log("Design Spec URL: ", artifact.url);
9});

Enums#

ArtifactType :
`PROTOTYPE, SPECS` - Type of shared artifact: interactive prototype only, or developer-focused specs view (which may also include access to an interactive prototype view)
TargetPlatform :
`WEB, IOS, ANDROID` - Target platform for published design specs
AccessLevel :
`LINKABLE, PASSWORD_PROTECTED, INVITE_ONLY` - Access level of the shared link: accessible to anyone with the link, anyone with the link + password, or only specific Creative Cloud user accounts

Typedefs#

Typedef BaseSharedArtifact#

Properties common to both types.

PropertyTypeDescription
typeArtifactTypeType of shared artifact
urlstringURL to view in browser
namestringName of shared artifact (often, but not always, matches the document name)
accessLevelAccessLevelLevel of access protection
allowCommentsbooleanTrue if stakeholders can post comments on this artifact

Typedef PrototypeArtifact#

Interactive prototype view generated via "Share for Review."

PropertyTypeDescription
embedURLstringURL for embedding a view of the prototype inside an iframe (compact view with minimal surrounding UI)
embedWidthnumberiframe width needed to display embedURL. May include room for navigation UI in addition to the prototype's content itself.
embedHeightnumberiframe height needed to display embedURL. May include room for navigation UI in addition to the prototype's content itself.
fullscreenInPagebooleanTrue if prototype defaults to a view that fills the entire page, with no surrounding UI visible for navigation, commenting, etc.
hotspotHintsbooleanTrue if clicking in non-interactive parts of the prototype flashes visual hints indicating the interactive spots

Typedef SpecsArtifact#

Developer-oriented specs view generated via "Share for Development." This may also allow viewing the document as an interactive prototype, with default settings (fullscreenInPage: false and hotspotHints: true).

PropertyTypeDescription
targetPlatformPlatformTypeTarget platform. Determines which information and measurement units are shown by default.

getSharedArtifacts()#

getSharedArtifacts(): Array.<PrototypeArtifact|SpecsArtifact>

Get a list of recently shared artifacts generated from this document. Older artifacts may not be included even if the shared links are still live. Shared links that have been deleted from the server (File > Manage Published Links) may still be listed here, as this API only provides a record of recent share actions from XD - not what the links' current status on the server may be.

The list may contain a mix of PrototypeArtifact and/or SpecsArtifact, and items are listed in no particular order. If nothing has been shared from this document, an empty array is returned.

Kind: static method of cloud

Was this helpful?
Copyright © 2021 Adobe. All rights reserved.