Version control overview
Learn how Knock versions your content and when to enable environments for a development-to-production workflow.
Knock versions the content (such as workflows, guides, and email layouts) that you send to your recipients. You draft your changes, test them, and publish them when they're ready, with a full history of every version.
How Knock versions content
#Every change you make to a content resource starts as a draft, which you can test with the dashboard test runner without changing what your application sends through the API. When a change is ready, you commit it, which makes it live and records it in your commit log. In production, the dashboard labels this action "Publish". Learn more in commits.
Data that you store in Knock about your recipients isn't versioned. It lives in the environment you send it to.
The environment model
#If you've worked on a software team, you've likely shipped code through separate environments to keep in-progress work that's still being tested away from your users. Knock's optional environments work the same way. Each environment has its own content, data, configurations, and API keys, so you can build and test changes in one environment without affecting what your users receive. When a change is ready, you promote it to the next environment, so production receives only the changes you've tested.
Single environment by default
#New Knock accounts start with a single environment. You build content directly in your dashboard, and publishing a change makes it live for your users.
- Create or edit a resource in the dashboard. Save your changes as a draft.
- Test the draft with the workflow or broadcast test runner.
- Publish the change when it's ready.
Each publish is a commit, so you can review what changed in each version and revert to an earlier one if needed.
Enabling environments
#Enabling environments adds a development environment below production and gives you a development-to-production workflow:
- Development environment. A separate place to build and test content, with its own API keys and data.
- Promotion. Commit changes in development, then promote them to production when they're ready.
- Additional environments. Add environments, such as staging, between development and production.
- Branches. Isolate changes on a branch and merge them into development when they're ready.
You can enable environments at any time. Once enabled, you can't switch back to a single environment.