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
type
ArtifactType
Type of shared artifact
url
string
URL to view in browser
name
string
Name of shared artifact (often, but not always, matches the document name)
accessLevel
AccessLevel
Level of access protection
allowComments
boolean
True if stakeholders can post comments on this artifact

Typedef PrototypeArtifact

Interactive prototype view generated via "Share for Review."

PropertyTypeDescription
embedURL
string
URL for embedding a view of the prototype inside an iframe (compact view with minimal surrounding UI)
embedWidth
number
iframe width needed to display embedURL. May include room for navigation UI in addition to the prototype's content itself.
embedHeight
number
iframe height needed to display embedURL. May include room for navigation UI in addition to the prototype's content itself.
fullscreenInPage
boolean
True if prototype defaults to a view that fills the entire page, with no surrounding UI visible for navigation, commenting, etc.
hotspotHints
boolean
True 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
targetPlatform
PlatformType
Target 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

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.