App Integration
This app workflow is designed to integrate with the Creatopy editor. It allows users to start a session in the Creatopy editor (AdStudio or LightEditor) while logged in, directly from a link click.
To access this workflow, the integrating client must provide a JWT as an entry point. This token should contain the clientId, userId (for session impersonation), and an action defining what the session will do before redirecting the user to editor mode. All of this must be signed with the secret.
The clientId and secret pair are created in Creatopy under Team Settings/API credentials.
You can generate the token using the NodeJS script:
or for testing purposes, you can use a JWT playground like the one from https://jwt.io/ where you can generate manually the token. To start the session just add the generated token to the Creatopy app https://app.creatopy.com/token-auth/${token}
The editor can be embedded in iframe too here's how: Iframe embedding
JWT Parameters
These are general parameters for starting the JWTtoken that starts the editor session.
Parameters for this action:
clientId
- (required) The clientId form the API Configuration inside Creatopy app (the same that is used to generate bearer token to call APIs requests)
userId
- (required) the userId for the user you impersonate in the session (if the clientId/secret pair is generated by the team owner or admin, you can impersonate users from your team).
action
- (required) define the action that this session if started for defined here.
sessionConfig
- usually UI configs for the current session. More on them here.
Actions for the session
To start a session, you need to provide an action type. Currently, we support four actions: create_design_from_template, create_blank_design, edit_design, and get_share_link. Add the action/type field in the JWT to call these actions. Each action has a set of specific parameters, which are explained for each type below.
Edit design
This action will create a new design from an existing one (template).
Parameters for this action:
hash
- The hash of the template (design or custom template)
editorMode
- Which editor to open in the session ("adStudio" or "light-editor")
Create a design from a template
This action will create a new design from an already existing design (template).
Parameters for this action:
hash
- The hash of the template (design or custom template)
name
- The name I want the design to have (Optional)
projectId
- ID of the project in which we want this design to be created
folderId
- ID of the folder in which we want this design to be created (optional)
editorMode
- Which editor to open in the session ("adStudio" or "light-editor")
Create blank design
This action will create a new blank design.
Parameters for this action:
sizes
- An array of sizes for the design
name
- The name I want the design to have (Optional)
projectId
- ID of the project where the design will be created
folderId
- ID of the folder where the design will be created (optional)
editorMode
- Editor to open in the session ("adStudio" only)
Get share link
This action will get you the shared link for a design or a folder based on the provided parameters, if you give a designHash
, you will get a shared link for a design. And, if you give a folderId
, you will get a shared link for a folder. One of these parameters must be provided.
This action now supports an optional parameter, openRightBar
, to provide additional functionality for the share link page.
Parameters for this action:
designHash
- The hash of the design that you want its share link (could beundefined
if you providefolderId
)
folderId
- The id of the folder that you want its share link (could beundefined
if you providedesignHash
)
openRightBar
- Iftrue
, opens the comments panel on the share link page. Has no effect ifuseShareLinkComments
in thesessionConfig
is disabled. (this param is optional and its default value isfalse
)
Behavior of openRightBar Param
When
openRightBar
is set totrue
:The comments panel will open automatically when the share link page is accessed, provided that
useShareLinkComments
in thesessionConfig
is enabled.If
useShareLinkComments
is disabled, this parameter will be ignored, and the comments panel will not be displayed.
When
openRightBar
is omitted or set tofalse
, the comments panel will remain closed by default.
Flow: Create from Url (BETA)
This action will start the flow of creating a design from a URL using AI
Parameters for this action:
projectId
- ID of the project where the design will be created
folderId
- ID of the folder where the design will be created (optional)
Flow: Create from a template (BETA)
This action will start the flow of creating a design from the template
Parameters for this action:
projectId
- ID of the project where the design will be created
folderId
- ID of the folder where the design will be created (optional)
Flow: Create from assets (BETA)
This action will start the flow of creating design from assets (logo, images etc.)
Parameters for this action:
projectId
- ID of the project where the design will be created
folderId
- ID of the folder where the design will be created (optional)
Session Configuration
The sessionConfig
object allows users to customize their white-label session by enabling or disabling certain features like design download and share link comments. By providing this configuration in their JWT token, end users can control session behavior based on their specific needs.
Object Structure
Properties
useDownload
Boolean
false
No
Enables or disables the option to download design within the session. If true
, download functionality is available; if false
, it is disabled.
useShareLinkComments
Boolean
false
No
Enables or disables the option to add comments to share links within the session. If true
, comments are allowed; if false
, they are not.
useShareButton
Boolean
true
No
Enables or disables the option to use the share button. if true
the share button appears, if false
, the share button is hidden
useAiEditText
Boolean
true
No
Enables or disables the usage of editing text using AI. if true
this option is enabled and if false
it's disabled
useAiEditImage
Boolean
true
No
Enables or disables the usage of editing image using AI. if true
this option is enabled and if false
it's disabled
useAiTranslate
Boolean
true
No
Enables or disables the usage of translation using AI. if true
this option is enabled and if false
it's disabled
useAdServing
Boolean
true
No
Enables or disables the usage of Ad Serving. if true
this option is enabled and if false
it's disabled
brandkitIds
Array of Brandkit Ids
[]
No
Gives you the control to limit the brandkits that are shown in AdStudio. If it's not provided, the brandkits available will depand on the brand control defined on team and project level
Usage
To configure these session options, include the sessionConfig
object in the payload of your JWT token. This configuration will then be applied to the session.
In this example:
useDownload: false
disables downloads for the session.useShareLinkComments: true
enables comments on shared links.The share button is active (
useShareButton: true
).AI-powered text editing is disabled (
useAiEditText: false
), while AI image editing is enabled (useAiEditImage: true
).AI translation is disabled (
useAiTranslate: false
).Ad serving is active (
useAdServing: true
).Brand-specific configurations are applied based on
brandkitIds
.
Notes
Optional Properties: All properties in the
sessionConfig
object are optional. If not provided, default values will apply.You can start your session without the
sessionConfig
provided and the default values will also be applied in this case.Brand Kit Support: If
brandkitIds
is not specified or is an empty array, no brand-specific configurations will be applied.
Supported Toolbar Items (Tools
)
Tools
)The following toolbar items can be specified for hideToolbarItems
or hideAllToolbarItemsExcept
:
"templates"
"elements"
"brandKit"
"layers"
"slides"
"animator"
"feedTool"
"apps"
"resize"
"help"
Usage Rules for Toolbar Configuration
Mutual Exclusivity: The parameters
hideToolbarItems
andhideAllToolbarItemsExcept
are mutually exclusive. You cannot use both at the same time. If both are provided, the session will fail to load the configuration.Functionality:
hideToolbarItems
: Specifies toolbar items to be removed from the left toolbar.hideAllToolbarItemsExcept
: Specifies toolbar items to remain visible, removing all others.
Examples
Example 1: Hiding Specific Toolbar Items
To hide only the "templates"
and "elements"
toolbar items:
Example 2: Keeping Specific Toolbar Items Visible
To hide all toolbar items except "templates"
and "elements"
:
Notes
Empty Arrays: Providing an empty array for
hideToolbarItems
orhideAllToolbarItemsExcept
will result in no changes to the toolbar.Priority: Ensure only one of
hideToolbarItems
orhideAllToolbarItemsExcept
is included to avoid conflicts.User Experience: Consider the user's workflow before hiding or limiting access to toolbar items to ensure functionality aligns with their needs.
Last updated