> ## Documentation Index
> Fetch the complete documentation index at: https://docs.configu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configs History

Configu has a robust [logging](/integrations/store/configu/audit-logs) and versioning system.
Similar to how source controls like git work, every action is recorded, viewable and can be reverted if necessary.

The history log is available for three entities:

* Set - allows you to see the history of the entire Set with every change
* Config - allows you to see the history of a specific config (key & set)
* Version Tag - allows you to set a snapshot as a version and then jump between versions

<Frame>
  <img src="https://mintcdn.com/configu/SzCqdOva2zT0ybfH/images-old/configs-history/history-sets.png?fit=max&auto=format&n=SzCqdOva2zT0ybfH&q=85&s=071941d50df5d509ef365cf56eea06be" alt="image" width="1350" height="418" data-path="images-old/configs-history/history-sets.png" />
</Frame>

### Revision Tags

Tags are a way to mark a specific snapshot of the organization's configs as a version.
Once a tag is created, you can compare it with the current state of your organization and revert to it.
**Tags can be created, viewed, and reverted only by the organization's admins.**

<Warning>Tags can only be created and applied to the entire organization, not to a specific set or config.</Warning>

#### Create a tag

In order to create a tag you'll first need to create a token with the `Admin` role.
See [Tokens](/integrations/store/configu/tokens#assign-roles-to-a-token) for more information about creating tokens and assigning them roles.

Once your token is ready, you can create a tag with the following request to our API:

```shell theme={null}
curl --request POST \
  --url https://api.configu.com/config/tag/revision \
  --header 'Content-Type: application/json' \
  --header 'Org: YOUR_ORG_ID' \
  --header 'Token: YOUR_TOKEN' \
  --data '{
	"tag": "v1.0.0"
}'
```

<Info>Tag can be any alphanumeric string. optionally with the following characters: `. _ / -`</Info>
<Tip>Your organization ID can be found under [organization settings](/integrations/store/configu/settings)</Tip>

Upon success (status 200), your tag will be ready for use.
You can now view it in the history log and revert to it if necessary by opening the action menu and clicking **Show diff**.

<Frame>
  <img src="https://mintcdn.com/configu/SzCqdOva2zT0ybfH/images-old/configs-history/history-tags.png?fit=max&auto=format&n=SzCqdOva2zT0ybfH&q=85&s=70f6f4bdc0e310b00582b478fe34ff64" alt="image" width="2872" height="642" data-path="images-old/configs-history/history-tags.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/configu/SzCqdOva2zT0ybfH/images-old/configs-history/history-show-diff.png?fit=max&auto=format&n=SzCqdOva2zT0ybfH&q=85&s=99b17b7b1cb0e53280c0cd4e83de935f" alt="image" width="2872" height="642" data-path="images-old/configs-history/history-show-diff.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/configu/SzCqdOva2zT0ybfH/images-old/configs-history/history-revert-tag.png?fit=max&auto=format&n=SzCqdOva2zT0ybfH&q=85&s=531379943366b7d996f097cb0ba070b2" alt="image" width="2872" height="1108" data-path="images-old/configs-history/history-revert-tag.png" />
</Frame>

<Info>Only members with the `Admin` role have permission to access the `show diff` and `revert` actions.</Info>

#### Evaluating with a tag

You can use a tag to evaluate your configs with a specific snapshot of any existing tags to ensure your evaluations are deterministic. To do this, use `ConfiguConfigStore` with the `tag` parameter using any existing tag name.

Example usage with the [Node.js SDK](/interfaces/sdk/node/overview):

```js theme={null}
import { ConfiguConfigStore, ConfigSet, ConfigSchema, EvalCommand, ExportCommand } from '@configu/node';
import schemaContents from './start.cfgu.json';

(async () => {
  try {
    const store = new ConfiguConfigStore({
      credentials: {
        org: process.env.CONFIGU_ORG,
        token: process.env.CONFIGU_TOKEN,
      },
      tag: 'v1.0.0',
    });
    const set = new ConfigSet('test');
    const schema = new ConfigSchema('start', schemaContents);

    const data = await new EvalCommand({
      store,
      set,
      schema,
    }).run();

    const configurationData = await new ExportCommand({
      pipe: data,
    }).run();
  } catch (error) {
    console.error(error);
  }
})();
```

To evaluate using the CLI, make sure to set the `CONFIGU_TAG` environment variable to the tag name you wish to use or provide the `tag` parameter directly [via a `.configu` file](/interfaces/.configu).

<Warning>
  * Attempting to evaluate a tag that does not exist will result in an error.
  * Evaluating configs without having the `read` permission will return an empty value.
</Warning>

<Info>
  * Evaluations with a tag will be marked with the tag in the [audit log](/integrations/store/configu/audit-logs). -
    Evaluations with a tag will trigger webhooks with the tag name in the payload as `tag`.
</Info>

#### Exploring a tag

You can view the content of a tag by clicking `explore tag`.

<Frame>
  <img src="https://mintcdn.com/configu/SzCqdOva2zT0ybfH/images-old/configs-history/history-explore-tag.png?fit=max&auto=format&n=SzCqdOva2zT0ybfH&q=85&s=f972993f965b109406910478533f4d91" alt="image" width="2872" height="668" data-path="images-old/configs-history/history-explore-tag.png" />
</Frame>

This will take you to the explorer tab where you will see the snapshot of the the tag. You can utilize the existing features of the tab to explore the snapshot.

<Frame>
  <img src="https://mintcdn.com/configu/SzCqdOva2zT0ybfH/images-old/configs-history/history-exploration-mode.png?fit=max&auto=format&n=SzCqdOva2zT0ybfH&q=85&s=cc44c9023c74ebeffbad551145148fe7" alt="image" width="2872" height="878" data-path="images-old/configs-history/history-exploration-mode.png" />
</Frame>

<Info>
  All navigation options are disabled during tag exploration.

  <br />

  All regular config action menu options besides `show value` are disabled during tag exploration.

  <br />

  You can view the value of the configs if you have the appropriate permission.
</Info>

At any point you can exit the exploration mode by clicking `return to latest tag` in the banner at the top of the page.

<Frame>
  <img src="https://mintcdn.com/configu/SzCqdOva2zT0ybfH/images-old/configs-history/history-exit-exploration-mode.png?fit=max&auto=format&n=SzCqdOva2zT0ybfH&q=85&s=c4be060ff89c1f463014692aab1f3dc1" alt="image" width="2872" height="878" data-path="images-old/configs-history/history-exit-exploration-mode.png" />
</Frame>

### Rollbacks

For every history log entry, you will see a *Revert Changes* button inside the diff window.

<Frame>
  <img src="https://mintcdn.com/configu/SzCqdOva2zT0ybfH/images-old/configs-history/configs-history-diff.png?fit=max&auto=format&n=SzCqdOva2zT0ybfH&q=85&s=886c2118dd8d14186926d921698151d4" alt="image" width="1350" height="400" data-path="images-old/configs-history/configs-history-diff.png" />
</Frame>
