How do I create a Clickmax App in My apps?
Create the app in Settings > Connections, My apps tab, with Create app. Clickmax shows the Client ID and the Client secret, which your server uses to receive each installation and call the API. How the app reaches a workspace is in How does a Clickmax App get installed and act in a workspace?.
Before you start
- You need the Apps permission in the workspace that will create the app. Owners and admins already have it. See Roles and permissions.
- You need a server to keep the client secret and exchange install codes. The secret never goes to a browser or a mobile app.
- If the tab shows Creating apps is not available on this account., the account cannot create apps.
- During a Clickmax support access, creating, editing, generating a secret and deleting are disabled.
Create the app
- In Settings > Connections, open the My apps tab and click Create app.
- In Name, type the name the people installing the app will see.
- In Logo URL and Website, enter
httpsaddresses if you want. Both are optional. - In Redirect URLs, enter where Clickmax returns after the install: up to 10 URLs, one per line. For an app that only opens inside the panel (with an Address in Clickmax), the field can stay empty. Use
https. To test on your computer, usehttponlocalhost,127.0.0.1or[::1], such ashttp://127.0.0.1:3000/clickmax/callback. The URL your system sends in the authorization must equal one of these, with the same port and path. - In Setup URL, enter, if you want, where Clickmax takes the person after an install started in Clickmax. The address receives the installation ID. Use
https, orhttponlocalhostfor testing. - In Requested permissions, check what the app will ask for when installed. Permissions no app can receive show as locked.
- In Who can install, choose Private (this workspace only) or Unlisted (any workspace, from your system or through the install link). You can change it later.
- Click Create app.
- Copy the Client ID and the Client secret, and keep the secret in a secret manager. The secret starts with
cxp_cs_and is shown only now. For a Private app, the dialog also shows the Installation ID: the app is already installed in this workspace, with what it asks for and you can do here (the rest stays pending in Installed apps), and your server can request its token with that ID. Then click I stored it.
The app shows up in the My apps list with its Client ID, its Redirect URLs and how many permissions it asks for. An app installed in this workspace shows Installed, which leads to Installed apps.
Connect your system to the app
For installs that start in your system:
- In your system, add a button to connect with Clickmax that calls a route on your server.
- In that route, build the authorization request with the
installscope, a PKCE code and astate, and send the person to the Clickmax authorization address. - At the redirect URL, check the
state, exchange the code for the installation and store theinstallation_idwith the workspace. - To call the API, request the installation token with the client ID and secret.
For installs that start in Clickmax, through the install link or the Install button:
- At the Setup URL, read the
installation_idit receives. - Check that ID in the app's installation list, with the client ID and secret, before trusting it. Anyone can open the Setup URL with a made-up ID.
- Store the
installation_idwith the workspace the list returns. Do not tie the installation to the person signed in to your system just because they arrived through the Setup URL.
Without a Setup URL, your server finds new installations in the app's installation list. The automatic install of a Private app does not go through the Setup URL either: the ID shows in the creation dialog and in the list.
Parameters, responses and a complete example server are in the Clickmax Apps OAuth reference. With the TypeScript SDK, see Use Clickmax App credentials and the sample app in the public clickmax-apps-sample repository.
Open the app inside Clickmax
With Address in Clickmax filled in, the app shows up under Apps in the panel sidebar for members of the workspaces where it is installed and active. Whoever opens it needs the View and open installed apps permission. What the person and the app can do together is in Apps inside Clickmax.
- In My apps, click Edit on the app.
- In Address in Clickmax, enter the
httpsaddress of the app screen the panel will load, with no user name or password. It cannot be an address of the Clickmax panel itself. - Click Save.
On the app's side:
- On the screen the panel loads, talk to the panel through the bridge (
postMessagemessages): say the screen is ready, receive the theme, the language, the workspace and the installation, and ask for a session token when you need to call your server. Accept only messages coming from the panel's origin,https://app.clickmax.io. - Send the session token to your server in the
x-clickmax-session-tokenheader. Inside the panel, the browser blocks your site's cookies. - On the server, exchange the session token for an access token with the client ID and secret, and call the API with it. The session token is valid for 60 seconds and a single exchange; the access token for 10 minutes.
The bridge messages, the exchange fields, the errors and a TypeScript example are in Apps inside Clickmax, in the reference. An app built in Max Design skips this page: publishing the project creates the app for you. See Clickmax App built in Max Design.
Test the install on your computer
- Register your local server's loopback URL in Redirect URLs, such as
http://127.0.0.1:3000/clickmax/callback. Use the same address in the authorization request. - Run your local server with the client ID and secret.
- Open your system in the browser and click the connect button.
- On Clickmax, sign in, pick the workspace that created the app in Where to install and click Continue.
- Review the permissions and click Install.
The browser returns to your local server with the code. After the exchange, the app shows up in the workspace's Installed apps, marked This workspace's app.
To test the Setup URL, register a loopback address in it, such as http://127.0.0.1:3000/clickmax/setup, and install from Clickmax (see the next section).
Install the app from Clickmax
- In My apps, click Install on the app. The Clickmax install page opens with this workspace picked.
- Review what the app will be able to do and click Install.
With a Setup URL, the browser goes there with the installation ID. Without one, you come back to My apps, and the app shows Installed. A Private app is already installed when it is created; Install shows on it only after someone removes it in Installed apps.
Share the install link
- Make sure the app is Unlisted (see the next section).
- In My apps, click Copy install link on the app.
- Send the link to whoever will install it. Each person needs the Apps permission in the workspace where they install it.
The link has the form https://login.clickmax.io/apps/<Client ID>/install and does not change. On a Private app, Copy install link is disabled: Private apps can only be installed in this workspace. Switch to Unlisted to share the link.
Let other workspaces install the app
- In My apps, click Edit on the app.
- In Who can install, choose Unlisted and click Save.
- Offer your system's connect button or the install link to people in other workspaces. Each one needs the Apps permission in the workspace where they install it.
The list shows in how many other workspaces the app is installed.
Ask for more permissions
- In My apps, click Edit on the app.
- Change the Requested permissions and click Save.
In the workspaces that already installed the app, new permissions stay pending until someone there approves them in Installed apps. Whatever you remove from the request is removed from the installations.
Make the app private again
- In My apps, click Edit on the app.
- In Who can install, choose Private.
- If the app is installed in other workspaces, the screen warns that it stops working there. Click Save and suspend in other workspaces.
The installations of other workspaces stay suspended until the app is Unlisted again.
Generate a new secret
- In My apps, click Generate new secret on the app.
- Confirm with Generate new secret.
- Copy the new secret, update your server and click I stored it.
The previous secret stops working right away. Tokens already issued with it stay valid until they expire, within 10 minutes at most.
Delete the app
- In My apps, click Delete on the app.
- Confirm with Delete app.
The app is removed from every workspace where it is installed, and its credentials stop working. This cannot be undone.