Welcome

Level up your .env game with tawbar

tawbar is designed to remove hustle of working with .env files, such as:

  • sharing .env among team members
  • keeping secrets in sync across different services and machines
  • updating secrets and comparing configurations across environments

Set up your tawbar project

1. After creating a tawbar project, you should configure your list of environments - we call them states (ex: staging, production).

2. Variables can be added manually and defined for each state or imported via our import function:

Tawbar's project table with named areas: states and variables

After you create/move your project’s secrets into tawbar you can invite your teammates to join your organization and use tawbar as a single source of truth for .env files

Fetch secrets from tawbar

Using tawbar CLI is the most convenient way to fetch secrets from tawbar. Think about it as of a simple version of git CLI, which works with your secrets.You can download your project secrets with a single command:

tawbar fetch {PROJECT_NAME} {STATE}

Where

  • {PROJECT_NAME} – name of your tawbar project
  • {STATE} – state variables of which you want to fetch (ex: development)

Learn more about installation, available commands and options here.

Integrate tawbar into your CI/CD pipeline

Using API

tawbar allows fetching your secrets into .env file using API. Here is an example of using tawbar API with curl

curl -H "Authorization: {SECURITY_TOKEN}" https://api.tawbar.com/projects/v1/{PROJECT_ID}/{STATE} -o .env

Where

  • {SECURITY_TOKEN} – your security token. Lean more
  • {PROJECT_ID} – you can find in project's settings.
  • {STATE} – is the state you defined for this project (ex: staging).

The example above will create an .env file in the current directory that will contain secrets from the speficied state of your project.

For more information on tawbar API methods and security please read our API reference.

Using CLI

Please consider using our CLI solution for CI / CD integrations as it provides more convenient access to tawbar API. Here is an example of the fetch command with additional options:

tawbar fetch {PROJECT_NAME} {STATE} -t {SECURITY_TOKEN} -p {PATH}

Where

  • {SECURITY_TOKEN} – security token. We recommend generating separate security tokens for every integration for security reasons. Lean more
  • {PATH} – path to file you want to save your secrets to (ex: /usr/my-app/.env)

Set up 2-way integration

With tawbar webhooks you can keep your secrets in sync across different services and machines. You can set them up to watch specific environments and send HTTP request to a specified URL as soon as their configuration gets changed in tawbar:

Webhook configuration for a tawbar project