Overview
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.
ocp 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.
However, there can be hundreds of requests running simultaneously, so avoid race conditions when interacting with external storage and APIs.
Index
Namespaces
Enumerations
- AttributableMetric
- ChannelType
- DeliveryMetric
- DisengagementMetric
- EngagementMetric
- JobRunStatus
- LogLevel
- LogVisibility
- ReachabilityMetric
Classes
- AuthorizationGrantResult
- Batcher
- CampaignEvents
- Channel
- ChannelContentResult
- ChannelPreviewResult
- ChannelTargetResult
- CsvStream
- FileStream
- FormResult
- Function
- FunctionApiError
- FunctionClassNotFoundError
- GlobalFunction
- Headers
- Job
- JobApiError
- JobNotFoundError
- JsonLinesStream
- Lifecycle
- LifecycleSettingsResult
- LiquidExtension
- LiquidExtensionResult
- LocalAsyncStoreBackend
- NumberSet
- Request
- Response
- Runtime
- StringSet
Interfaces
- AppConsumer
- AppContext
- AppFunction
- AppJob
- AppLiquidExtension
- AppManifest
- BaseKVStore
- CampaignContent
- CampaignDelivery
- CampaignTargeting
- CampaignTracking
- CanUninstallResult
- ChannelDeliverOptions
- ChannelDeliverResult
- ChannelPrepareOptions
- ChannelPrepareResult
- ChannelPublishOptions
- ChannelRateLimit
- ChannelTemplatePreviewResult
- ChannelValidateOptions
- ConsumerResult
- CsvRow
- FileRowProcessor
- FunctionApi
- FunctionEndpoints
- ILogger
- JobApi
- JobDefinition
- JobDetail
- JobInvocation
- JobStatus
- JsonLineRow
- KVHash
- KVRowOptions
- KVStore
- LifecycleResult
- LiquidExtensionContext
- LiquidExtensionInput
- LoggerOptions
- MultiValue
- Notifier
- PreviewDisplayOptions
- QueryParams
- SleepOptions
- SubmittedFormData
- ValueHash
Type Aliases
- AppCategory
- AppRuntime
- BatchOperation
- CampaignAction
- CsvReadableStreamBuilder
- CsvRowProcessor
- FileReadableStreamBuilder
- HttpMethod
- Intent
- JsonLineReadableStreamBuilder
- KVPatchUpdater
- KVValue
- PatchUpdater
- Value
Variables
- APP_ID_FORMAT
- DEFAULT_LOG_LEVEL
- LOG_LEVELS
- LOG_LEVELS_BY_STRING
- VENDOR_FORMAT
- VERSION_FORMAT
- functions
- jobs
- logger
- notifications
- storage
Functions
Updated 2 months ago