Dev GuideAPI Reference
Dev GuideUser GuidesGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Register and scaffold your app

Register your app ID and scaffold the project structure with the OCP CLI.

Use the OCP CLI to register your app ID and scaffold the project structure.

Register your app

Register your app and complete the prompts to give your app a unique app ID and name, define OCP as the target product, and mark the app as shareable with other developers in your organization.

🚧

Important

Ensure you choose Connect Platform as the app's target product. Your app ID must be in snake_case: each word is lowercase, with spaces replaced by underscores.

ocp app register

This command returns the following prompts that you must complete:

The app id to reserve: YOUR_APP_ID
The display name of the app: YOUR_APP_DISPLAY_NAME
Target product for the app: Connect Platform
Keep this app private and not share it with other developers in your organization? No

Your answer to the Keep this app private prompt controls who can access your app:

  • Yes – Your app is visible only to your developer account. Other developers in your organization cannot see or modify the app.
  • No – Your app is shared with other developers in your organization. They can view, modify, and publish new versions.

Scaffold the app

The CLI downloads a template and creates the project directory with the necessary files. The following templates are available:

  • Empty Project – A minimal app without example code.
  • Basic Sample – A starter app with example functions and jobs.
  • Opal Template App – A template for building Opal tool apps.
🚧

Important

Do not select any of the following categories:

  • Loyalty & Rewards
  • Reviews & Ratings
  • Commerce Platform
  • Content Management
  • Offers
ocp app init

This command returns the following prompts that you must complete:

Name of your app (e.g., My App): YOUR_APP_DISPLAY_NAME
ID of your app [ocp_quickstart]: YOUR_APP_ID
Version [1.0.0-dev.1]: 1.0.0-dev.1
App Summary (brief): YOUR_APP_SUMMARY
Support URL: YOUR_SUPPORT_URL
Contact email address: YOUR_SUPPORT_EMAIL
Select the category for the app: YOUR_APP_CATEGORY
Select a template project: Empty Project
  • Support URL – The URL where OCP users can find support resources for your app. This displays in the App Directory listing.
  • Contact email address – The email address where OCP users can contact you for support. This displays in the App Directory listing and in the app settings tab.

See App versioning for details on versioning your app.

Open the project in your preferred editor and run git init to initialize version control.

Retrieve your tracker ID

To publish and install your app, you need the tracker ID of the OCP account where you want to install it. Run the ocp accounts whois ACCOUNT_NAME command in the OCP CLI and copy the tracker ID. Replace ACCOUNT_NAME with the name of your OCP account:

$ ocp accounts whois acme

id          tracker Id                    name             target product
1234        euYdNiVdeR                    Acme Test        OCP

If you do not know your account name, run ocp accounts whoami command to list the accounts you have developer access to. If the account does not appear, you have access through the user interface (UI) but not developer access. Contact Optimizely Support to request developer access.

$ ocp accounts whoami                                                   
personal_apps:
  - id: john_personal_app
id: c19a5189-5a0d-4b7f-8272-f26b5d954320
email: [email protected]
role: deployer
githubUsername: johnsmith
accounts:
  - trackerId: euYdNiVdeR
    shard: us
  - trackerId: KcTMuByrxc-eu1
    shard: eu
  - trackerId: KDMqBYgRRd-au
    shard: au
createdAt: '2025-01-01T15:00:00'
vendor: acme
vendor_apps:
  - id: acme_app

Run ocp accounts whois TRACKER_ID for each tracker ID from the previous command to find the account name associated with each ID.

$ ocp accounts whois euYdNiVdeR

id          tracker Id                    name             target product
1234        euYdNiVdeR                    Acme Test        OCP
📘

Note

If your account is not in the US default shard, you must add the -a=SHARD parameter to the ocp accounts whois TRACKER_ID command.