App SDK
The App SDK includes helpers and interfaces for apps running on the Optimizely Connect Platform (OCP).
Get started
The following OCP command-line interface (CLI) command scaffolds your app and installs the dependencies, including this SDK.
opti app init
The basics
OCP apps are built on the Node platform with support for Node 18 and Typescript. Follow Typescript best practices to ensure more stable integrations with fewer bugs.
OCP apps are required to follow conventions outlined in the developer docs. They are composed of:
- .env – Environment secrets that are published securely with an app.
- app.yml – A description of an app, including its abilities and requirements.
- forms/ – YAML-based forms that generate UIs for customer interactions.
- src/channel – Channel-based app implementation.
- src/functions/ – Webhooks for receiving data and serving content.
- src/jobs/ – Scheduled and triggered jobs to handle long running/recurring tasks.
- src/lifecycle/ – Handler for lifecycle actions (install/uninstall/OAuth/submit settings updates).
- src/liquid-extension – Extensions for dynamic campaign content (powered by Shopify Liquid).
- src/schema – Custom fields and relations users are required to install with an app.
Apps are run in an isolated environment and to avoid data leaking/pollution across accounts, each process of an app only handles a single request at a time. However, there can be hundreds of processes running simultaneously, so avoid race conditions when interacting with external storage and APIs.