This repository provides a scaffold for building Genesys Cloud Functions using Deno 2.0. It is fully typed, testable, and structured to help you develop, document, and package Lambda-based functions for the Genesys Cloud platform.
Genesys Cloud Functions are custom AWS Lambda functions deployed and managed directly within the Genesys Cloud CX environment.
They are typically used for:
- 🧠 Custom routing logic (e.g., geo-based, time-based decisions)
- 🛠️ Data enrichment (e.g., lookups from external systems)
- 🔐 Security checks (e.g., validate requests before queuing)
- 📤 3rd-party integrations (e.g., CRM sync, ticket creation)
These functions are executed in response to specific events within Genesys — such as Architect call flows or interaction rules — and allow you to bring your own business logic to the platform.
To use this scaffold, ensure you have the following installed:
- Deno 2.0+
- GNU Make (for task automation)
You can verify installation like this:
deno --version
make --versionOn macOS, if Make is installed as
gmake, you can alias it or add its path via:set -Ux PATH /opt/homebrew/opt/make/libexec/gnubin $PATH
.
├── src/ # Source code
│ ├── mod.ts # Main handler (entrypoint)
│ └── types/ # Typed request/response definitions
├── test/ # Unit tests
├── build/ # Build logic (e.g., esbuild bundler)
├── dist/ # Build output (created by build step)
├── Makefile # Task runner (build/package/etc)
└── README.md
Your Genesys Cloud Function should export a handler like this:
export const handler: CloudFunctionHandler = async (request, context) => {
return {
requestReceived: request,
contextReceived: context,
};
};This function receives:
request: your custom JSON payload defined by Genesys Cloudcontext: AWS Lambda execution metadata
You can use the included Makefile to simplify building and packaging, but feel free to use the commands directly.
make buildThis will:
- Clean any previous build
- Run linting, formatting, and tests
- Bundle the function into
dist/index.jsusing esbuild
make docsThis creates a full HTML documentation site in:
dist/docs/
├── index.html
├── script.js
└── style.css
make packageThis zips the built function and generated docs into:
dist/lambda.zip
You can then upload this ZIP in the Genesys Cloud admin UI when deploying the function.
| Command | Description |
|---|---|
make |
Build, document, and package everything |
make build |
Format, lint, test, and bundle |
make docs |
Generate HTML docs into dist/docs/ |
make package |
Bundle index.js + docs into a ZIP |
make test |
Run all unit tests |
make lint |
Run linter |
make format |
Check code formatting |
make clean |
Delete the dist/ directory |
make update |
Update dependencies via deno outdated |
This project is licensed under the MIT License. See the LICENSE file for details.