Skip to main content

Creating and Loading Designs

Learn how to use the Client SDK to create and retrieve designs.

Create

Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });

const newDesign = await sdk.design.create('<projectId>', 'Test Design');

Signature

create(projectId, name);

Parameters

parametertypenote
projectId
(required)
stringThe ID of the project of this design
name
(required)
stringThe name of the design

Returns

A promise that resolves with the new design instance after it has successfully created. The design instance contains methods for interacting with the design, described in Controls and Actions.

The promise will reject with an error message if the design fails to create or load. Once the promise resolves, you can perform actions on the design instance.

Load

Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });

const design = await sdk.design.load(designId);

Signature

load(designId);

Parameters

parametertypenote
designId
(required)
stringThe id of the design

Returns

A promise that resolves with the new design instance after it has successfully loaded. The design instance contains methods for interacting with the design, described in Controls and Actions.

The promise will reject with an error message if the design fails to load. Once the promise resolves, you can perform actions on the design instance.

Design Load Errors

messagedescription
Could not fetch design; ensure that the design ID is validThe design failed to load to a missing or invalid design ID. Make sure that the design ID is valid and that the user is associated with the correct tenant.
Not authorized to access Design ID <design_id>The design failed to load because the account associated with the access token does not have access to the design. The tenant admin should be able to grant access to the design.
JWT token expired or not authorized to access designThe design failed to load because the access token is expired or invalid. Generate a new token and try again. If this fails, ensure the user account has access to the design.