Platform
Version control
Environments

Environments

Learn how to use Knock environments.

Knock environments enable you to test and review changes before you ship them to production.

Each Knock environment has its own isolated data (such as users, tenants, and objects) and its own version-controlled content (such as workflows, guides, and layouts.)

How environments work

#

Your Knock account starts with two environments: development and production.

You can create additional environments (for example, a Staging environment to mirror your own development lifecycle.)

Environments contain isolated data (such as users, objects, and logs) and version-controlled content (such as workflows, layouts, and partials.)

With Knock environments you:

  • Use environment-specific API keys to send data to your environments.
  • Create, update, and version content within any environment.
  • For production-critical use cases, create content in your development environment, then promote it to production.

Here's a typical setup for customers using Knock with two environments.

  • Development environment. Usually used by engineering and product teams. Contains your development data, and any transactional workflows or other content you don't want people updating directly in production.

  • Production environment. Usually used by growth and marketing teams. Contains your production data, and your lower-risk content that doesn't need to follow promotion, such as lifecycle workflows and one-time announcements.

Send data to environments

#

Each environment has a set of data resources that are per-environment and will never be shared between environments. These data resources are not version-controlled.

The following data resources are per-environment and not version-controlled.

  • Users
  • Audiences
  • Tenants
  • Objects
  • Messages
  • Analytics
  • Logs
  • Events
  • Broadcasts

An example: the users you identify in Knock. Your real production users are identified in your production environment, while your test development users are identified in your development environment.

Each environment has its own set of API keys which you use to send data to the environment. You can find your environment-specific API keys under "Platform" > "API keys" in the Knock dashboard.

Create content in environments

#

Each environment has a set of content resources that are managed via version control. These are resources associated with the creation and orchestration of the content you send to your customers, such as workflows, layouts, and templates.

The following content resources are version-controlled.

  • Workflows
  • Guides
  • Layouts
  • Partials
  • Translations
  • Reusable requests

Here's how content resources work:

  • Content can be created in any environment.
  • Content can be promoted upwards through environments.
  • Content can only be edited in the environment in which it was created.
  • Content is versioned with commits. You can roll back to earlier commits at any time.

These rules enable two ways of working with content and shipping it to your end users in production:

For content managed by engineering, such as high-volume transactional workflows, this path ensures that content can only be updated in development before being promoted to production.

  1. Create and update the content in your development environment
  2. Commit the changes to your development environment
  3. Promote the changes to your production environment when ready

For content managed by growth, marketing, and product, such as feature announcements and lifecycle workflows, this path is faster and doesn't require the promotion step.

  1. Create and update the content in your production environment
  2. Publish (commit) the changes to your production environment when ready

Create additional environments

#

By default your Knock account comes with two environments: development and production. If you need an additional environment in Knock to mirror your own development lifecycle (for example, a staging environment) you can add it on the settings page of the Knock dashboard.

To create a new environment, go to the Environments page under the Version control section of your account settings. You'll see a button to "Create environment."

When you create an additional environment, it will be inserted between development and production for environment promotion purposes. Any additional new environments will always be added one "level" lower than Production; environments cannot be re-ordered, as this would break the promotion model for previously-promoted changes.

Environment access controls

#

We recognize the importance of protecting your sensitive data, so we designed Knock from the ground-up with privacy and security in mind.

There are two tools you can use to control access to your data in the Knock dashboard:

  • Roles and permissions. Knock offers granular roles for the different functions your team members may want to carry out in Knock, such as support team members that need to debug issues for customers but shouldn't be making changes to notification logic.
  • Customer data obfuscation. You can use our per-environment data obfuscation controls to configure whether you want your team members to be able to view customer data in the Knock dashboard.

Frequently asked questions

#

No, you cannot programmatically create or delete environments. You can only create and delete environments through the Knock dashboard at this time.