Workflow
Projects
An Eventvisor project is ideally a separate repository from your application(s), where you manage various entities like events, attributes, and destinations.
Creating a project#
The easiest way is to use the Eventvisor CLI through npx (Node.js).
Create a new project directory first:
$ mkdir my-project$ cd my-projectAnd inside the newly created directory, initialize an Eventvisor project:
$ npx @eventvisor/cli initThe default scaffold uses YAML. You can also start from a complete reference project:
npx @eventvisor/cli init --project=demonpx @eventvisor/cli init --project=no-environmentsnpx @eventvisor/cli init --project=environmentsnpx @eventvisor/cli init --project=test-environmentsReference projects#
The public repository contains several projects that can be explored directly or used by eventvisor init:
| Project | Purpose |
|---|---|
project-demo | E-commerce storefront and checkout example with Targets, routing, transforms, effects, and matrix tests |
project-no-environments | Small standalone starter without Sets |
project-environments | Development, staging, and production modeled as Sets |
project-test-environments | Environment-specific routing and matrix test examples |
project-yml | YAML definitions |
project-json | JSON definitions |
project-monorepo | Independently configured projects in an npm workspace |
project-1 is the larger internal conformance project. It is useful when looking for advanced definitions, but project-demo is the better learning-oriented starting point.
Installation#
Afterwards, install the dependencies:
$ npm installPlatform agnostic usage#
While Eventvisor CLI itself depends on Node.js, your applications do not need to.
The idea is that an Eventvisor project will generate datafiles (static JSON files), which will later be consumed by applications using SDKs in different programming languages which do not need to have any ties to Node.js in any way.
The JavaScript SDK covers browser, Node.js, React, and React Native applications. The Java SDK supports JVM applications using the same runtime contract.
Directory structure#
$ tree ..├── attributes/│ ├── country.yml│ ├── deviceId.yml│ └── userId.yml├── datafiles/ (generated later)│ ├── eventvisor-web.json│ └── eventvisor-storefront.json├── destinations│ └── browser.yml├── events│ └── pageView.yml├── eventvisor.config.js├── package.json├── schemas│ └── identifier.yml├── targets│ └── storefront.yml└── tests ├── destinations │ └── browser.spec.yml └── events └── pageView.spec.ymlProject configuration#
eventvisor.config.js: contains your project configuration. Learn more in Configuration page.
Building blocks#
These are the directories where you will be defining all the building blocks for managing the project:
attributes/: contains all your attribute definitionsdestinations/: contains all your destination definitionsevents/: contains all your event definitionseffects/: contains all your effect definitionsschemas/: contains reusable Schema definitions shared by events and attributestargets/: contains dependency-aware Target selections for focused datafilestests/: contains all your test specs against your attributes, events, destinations, and effects
Output#
datafiles/: contains all your generated datafiles, which are meant to be consumed by SDKs in your applications
Git repository#
While it is intended that an Eventvisor project should be hosted in a separate standalone Git repository, it is not a strict requirement.
$ git init$ git add .$ git commit -m "Initial commit"You can still use the CLI to manage your project without a Git repository, or as part of your larger application codebase (think a monorepo setup).
However, it is highly recommended to use a standalone Git repository to keep track of your changes and collaborate with others. Keeping it separate from your application codebase allows you to your configuration changes from your application code deployments.
Multiple projects#
If you wish to have multiple Eventvisor projects in a single Git repository, refer to the guide in monorepo page.

