Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions website/docs/advanced/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ Commands:
t, tag Manage Tags
k, sdk-key List SDK Keys
scan <directory> Scan files for Feature Flag & Setting usages
eval Evaluate feature flags. In case of a single feature flag, by default, the command
writes only the evaluated value to the output. In case of multiple feature flags, the
command writes a table if no other format is specified
config-json Config JSON-related utilities
w, workspace Manage the CLI workspace. When set, the CLI's interactive mode
filters Product and Config selectors by the values set in the
workspace
w, workspace Manage the CLI workspace. When set, the CLI's interactive mode filters Product and
Config selectors by the values set in the workspace

Use "configcat [command] -?" for more information about a command.
```
Expand Down Expand Up @@ -277,7 +279,13 @@ The following example shows how you can create a feature flag in a specific conf

<img src="/docs/assets/cli/cli-flag-create.gif" alt="create flag" decoding="async" loading="lazy"/>

### Value update
### Evaluate feature flags

The following example shows how you can evaluate one or more feature flags.

<img src="/docs/assets/cli/cli-eval.gif" alt="evaluate flags" decoding="async" loading="lazy"/>

### Feature flag value update

The following example shows how you can update the value of a feature flag in a specific environment.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/advanced/code-references/github-action.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: github-action
title: GitHub Action - Scan your source code for feature flags
---

This section describes how to use ConfigCat's <a target="_blank" href="https://github.com/marketplace/actions/configcat-scan-repository">GitHub Action</a>
This section describes how to use ConfigCat's <a target="_blank" href="https://github.com/marketplace/actions/configcat-scan-repository">Scan Repository GitHub Action</a>
to automatically scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.
You can find more information about GitHub Actions <a target="_blank" href="https://github.com/features/actions">here</a>.

Expand Down
38 changes: 38 additions & 0 deletions website/docs/integrations/github-cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
id: github-cli
title: Install the ConfigCat CLI in GitHub Actions
description: This is a step-by-step guide on how to use the ConfigCat CLI in your GitHub Action workflow.
---

This section describes how to install and use the ConfigCat CLI in GitHub Action workflows.

### Prerequisites

- To let the CLI access the ConfigCat Public Management API, you have to create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">API credential</a>.
Store the credential in your repository's <a target="_blank" href="https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository">GitHub Secrets</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.

<img src="/docs/assets/cli/scan/gh_secrets.png" alt="Github Action secrets" decoding="async" loading="lazy" />

### Example
The following example shows how you can install the ConfigCat CLI with ConfigCat's <a href="https://github.com/configcat/cli-actions" target="_blank">CLI Github Actions</a> in your workflow.

```yaml
name: Workflow with ConfigCat CLI
on: push
jobs:
example-job:
runs-on: ubuntu-latest
env:
CONFIGCAT_API_USER: ${{ secrets.CONFIGCAT_API_USER }}
CONFIGCAT_API_PASS: ${{ secrets.CONFIGCAT_API_PASS }}
steps:
- uses: configcat/cli-actions@v1

# Using the CLI in other steps
- name: Update feature flag value
run: configcat flag-v2 value update --flag-id <flag-id> --environment-id <environment-id> --flag-value true
```

:::info
The action doesn't execute the `setup` command. It's recommended to set the `CONFIGCAT_API_USER` and `CONFIGCAT_API_PASS` environment variables on a job level, so each subsequent step that uses a ConfigCat CLI command can access them.
:::
56 changes: 56 additions & 0 deletions website/docs/integrations/github-eval.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
id: github-eval
title: Evaluate feature flags in GitHub Actions
description: This is a step-by-step guide on how to evaluate ConfigCat feature flags in your GitHub Action workflow.
---

ConfigCat's <a href="https://github.com/configcat/cli-actions" target="_blank">CLI GitHub Actions</a> has the ability to evaluate feature flags in GitHub Action workflows.
This feature lets you use your feature flag values or create conditional steps in your workflow.

### Prerequisites

- An SDK key for the ConfigCat config/environment pair that contains the feature flags you want to evaluate.

### Example

The following example shows how you can evaluate ConfigCat feature flags and use the evaluated results in subsequent steps.

```yaml
name: Evaluate ConfigCat feature flags
on: push
jobs:
example-job:
runs-on: ubuntu-latest
steps:
- name: Evaluate feature flags
id: flags
uses: configcat/cli-actions/eval-flag@v1
with:
sdk-key: ${{ secrets.CONFIGCAT_SDK_KEY }}
flag-keys: |
flag1
flag2
user-attributes: |
id:1234

- name: Step depending on flag1
if: steps.flags.outputs.flag1 == 'true'
run: echo "flag1 is true"

- name: Step depending on flag2
if: steps.flags.outputs.flag2 == 'true'
run: echo "flag2 is true"
```

The results of the flag evaluations are stored in the step outputs named with each flag's key.

### Available Options

| Parameter | Description | Required | Default |
| ---------------- | ---------------------------------------------------------------------------------------------------------- | ---------- | ------------------- |
| `sdk-key` | SDK key identifying the config to download, also loaded from the `CONFIGCAT_SDK_KEY` environment variable | | |
| `flag-keys` | List of feature flag keys to evaluate. Multiple values must be in separate lines. | &#9745; | |
| `user-attributes` | List of user attributes used for evaluation. Multiple values must be in separate lines in the following format: `<key>:<value>`. Dedicated User Object attributes are mapped like the following: Identifier => id, Email => email, Country => country. | | |
| `base-url` | The CDN base url from where the CLI will download the config JSON. | | ConfigCat CDN servers. |
| `data-governance` | Describes the location of your feature flag and setting data within the ConfigCat CDN. Possible values: `eu`, `global`. | | `global` |
| `verbose` | Turns on detailed logging. | | false |
6 changes: 3 additions & 3 deletions website/docs/integrations/github.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
id: github
title: GitHub Action - Scan your code for feature flag usages
description: ConfigCat GitHub Action. This is a step-by-step guide on how to use the ConfigCat GitHub Action to eliminate tech debt in your project.
title: Scan your code for feature flag usages
description: This is a step-by-step guide on how to use the ConfigCat Scan Repository GitHub Action to eliminate tech debt in your project.
---

import CodeRefIntro from '/docs/advanced/code-references/\_intro.mdx'
import GitHubAction from '/docs/advanced/code-references/github-action.mdx'

<CodeRefIntro linkText="GitHub Action" linkUrl="https://github.com/marketplace/actions/configcat-scan-repository" linkTarget="_blank" />
<CodeRefIntro linkText="Scan Repository GitHub Action" linkUrl="https://github.com/marketplace/actions/configcat-scan-repository" linkTarget="_blank" />

[Here](../advanced/code-references/overview.mdx) you can find more details about how this feature works.

Expand Down
22 changes: 20 additions & 2 deletions website/docs/integrations/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,28 @@ Streamline your workflows by integrating ConfigCat with your essential tools and
<a className="integration-card" href="/docs/integrations/github">
<div className="title">
<div className="logo github"></div>
<div className="title-text">GitHub Action</div>
<div className="title-text">Scan Repository</div>
</div>
<div className="description">
<span>Discover feature flag usages in your source code and upload the found code references to ConfigCat.</span>
<span>Discover feature flag usages in your source code and upload the found code references with GitHub Actions.</span>
</div>
</a>
<a className="integration-card" href="/docs/integrations/github-cli">
<div className="title">
<div className="logo github"></div>
<div className="title-text">Install CLI</div>
</div>
<div className="description">
<span>Install and use the ConfigCat CLI in GitHub Action workflows.</span>
</div>
</a>
<a className="integration-card" href="/docs/integrations/github-eval">
<div className="title">
<div className="logo github"></div>
<div className="title-text">Evaluate feature flag</div>
</div>
<div className="description">
<span>Evaluate feature flags and make conditional steps in GitHub Action workflows.</span>
</div>
</a>
<a className="integration-card" href="/docs/integrations/terraform">
Expand Down
10 changes: 9 additions & 1 deletion website/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,15 @@ const sidebars: SidebarsConfig = {
},
{ type: 'doc', id: 'integrations/bitrise', label: 'Bitrise Step' },
{ type: 'doc', id: 'integrations/circleci', label: 'CircleCI Orb' },
{ type: 'doc', id: 'integrations/github', label: 'GitHub Action' },
{
type: 'category',
label: 'GitHub Actions',
items: [
{ type: 'doc', id: 'integrations/github', label: 'Scan & Upload Code References' },
{ type: 'doc', id: 'integrations/github-cli', label: 'Install CLI' },
{ type: 'doc', id: 'integrations/github-eval', label: 'Evaluate Feature Flags' },
],
},
{ type: 'doc', id: 'integrations/terraform', label: 'Terraform' },
],
},
Expand Down
8 changes: 5 additions & 3 deletions website/src/css/cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,16 @@
flex-direction: row;
align-items: center;
gap: 10px;
margin: 15px 15px 7px 15px;
margin: 15px 15px 10px 15px;

.logo {
flex-shrink: 0;
display: inline-block;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 40px;
height: 40px;
width: 30px;
height: 30px;

&.amplitude {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%231e61f0' d='M128 0c70.683 0 128 57.317 128 128s-57.317 128-128 128S0 198.734 0 128S57.317 0 128 0m-16.912 39.12c-15.782.051-30.073 25.445-42.359 75.412c-8.687-.103-16.655-.257-24.109-.36h-1.13c-.926-.052-1.851 0-2.777.103c-4.215.77-7.248 4.472-7.248 8.739c0 4.37 3.239 8.122 7.557 8.79l.102.103H64.72a578 578 0 0 0-5.706 29.404l-.72 4.164v.205a5.84 5.84 0 0 0 2.724 4.935c2.725 1.748 6.375.926 8.123-1.799l.154.154l11.566-37.063h55.724c4.266 16.141 8.687 32.745 14.548 48.373c3.135 8.379 10.435 27.913 22.67 28.016h.154c18.917 0 26.32-30.587 31.203-50.84c1.08-4.37 1.953-8.123 2.827-10.899l.36-1.13l.052-.167c.4-1.445-.416-2.988-1.851-3.483c-1.491-.514-3.187.257-3.701 1.799l-.412 1.13c-1.593 4.473-3.084 8.637-4.42 12.39l-.103.308c-8.225 23.184-11.926 33.774-19.277 33.774h-.463c-9.407 0-18.198-38.143-21.54-52.486c-.565-2.467-1.079-4.78-1.593-6.785h60.659c1.08 0 2.159-.257 3.136-.771l.047-.039a2 2 0 0 1 .21-.115l.308-.206l.154-.103c.155-.103.309-.206.463-.36l.227-.188c1.114-.969 1.903-2.321 2.24-3.719c.772-3.65-1.644-7.248-5.294-7.967h-.309c-.36-.052-.668-.103-1.028-.103l-.925-.103c-21.436-1.542-43.49-2.16-64.206-2.57l-.051-.155c-10.024-37.783-22.62-76.388-39.582-76.388m-.669 17.015c.874 0 1.697.514 2.416 1.44c1.748 2.775 4.832 8.995 9.408 22.772c3.135 9.459 6.528 21.23 10.126 34.904c-13.673-.205-27.45-.36-40.816-.514l-6.785-.051c7.66-29.918 16.964-52.588 23.8-57.934c.566-.36 1.183-.617 1.851-.617'/%3E%3C/svg%3E");
Expand Down Expand Up @@ -295,6 +296,7 @@

.title-text {
font-size: 18px;
line-height: 1.6rem;
font-weight: 700;
}
}
Expand Down
Binary file added website/static/assets/cli/cli-eval.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions website/versioned_docs/version-V1/advanced/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ Commands:
t, tag Manage Tags
k, sdk-key List SDK Keys
scan <directory> Scan files for Feature Flag & Setting usages
eval Evaluate feature flags. In case of a single feature flag, by default, the command
writes only the evaluated value to the output. In case of multiple feature flags, the
command writes a table if no other format is specified
config-json Config JSON-related utilities
w, workspace Manage the CLI workspace. When set, the CLI's interactive mode
filters Product and Config selectors by the values set in the
workspace
w, workspace Manage the CLI workspace. When set, the CLI's interactive mode filters Product and
Config selectors by the values set in the workspace

Use "configcat [command] -?" for more information about a command.
```
Expand Down
38 changes: 38 additions & 0 deletions website/versioned_docs/version-V1/integrations/github-cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
id: github-cli
title: Install the ConfigCat CLI in GitHub Actions
description: This is a step-by-step guide on how to use the ConfigCat CLI in your GitHub Action workflow.
---

This section describes how to install and use the ConfigCat CLI in GitHub Action workflows.

### Prerequisites

- To let the CLI access the ConfigCat Public Management API, you have to create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">API credential</a>.
Store the credential in your repository's <a target="_blank" href="https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository">GitHub Secrets</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.

<img src="/docs/assets/cli/scan/gh_secrets.png" alt="Github Action secrets" decoding="async" loading="lazy" />

### Example
The following example shows how you can install the ConfigCat CLI with ConfigCat's <a href="https://github.com/configcat/cli-actions" target="_blank">CLI Github Actions</a> in your workflow.

```yaml
name: Workflow with ConfigCat CLI
on: push
jobs:
example-job:
runs-on: ubuntu-latest
env:
CONFIGCAT_API_USER: ${{ secrets.CONFIGCAT_API_USER }}
CONFIGCAT_API_PASS: ${{ secrets.CONFIGCAT_API_PASS }}
steps:
- uses: configcat/cli-actions@v1

# Using the CLI in other steps
- name: Update feature flag value
run: configcat flag value update --flag-id <flag-id> --environment-id <environment-id> --flag-value true
```

:::info
The action doesn't execute the `setup` command. It's recommended to set the `CONFIGCAT_API_USER` and `CONFIGCAT_API_PASS` environment variables on a job level, so each subsequent step that uses a ConfigCat CLI command can access them.
:::
56 changes: 56 additions & 0 deletions website/versioned_docs/version-V1/integrations/github-eval.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
id: github-eval
title: Evaluate feature flags in GitHub Actions
description: This is a step-by-step guide on how to evaluate ConfigCat feature flags in your GitHub Action workflow.
---

ConfigCat's <a href="https://github.com/configcat/cli-actions" target="_blank">CLI GitHub Actions</a> has the ability to evaluate feature flags in GitHub Action workflows.
This feature lets you use your feature flag values or create conditional steps in your workflow.

### Prerequisites

- An SDK key for the ConfigCat config/environment pair that contains the feature flags you want to evaluate.

### Example

The following example shows how you can evaluate ConfigCat feature flags and use the evaluated results in subsequent steps.

```yaml
name: Evaluate ConfigCat feature flags
on: push
jobs:
example-job:
runs-on: ubuntu-latest
steps:
- name: Evaluate feature flags
id: flags
uses: configcat/cli-actions/eval-flag@v1
with:
sdk-key: ${{ secrets.CONFIGCAT_SDK_KEY }}
flag-keys: |
flag1
flag2
user-attributes: |
id:1234

- name: Step depending on flag1
if: steps.flags.outputs.flag1 == 'true'
run: echo "flag1 is true"

- name: Step depending on flag2
if: steps.flags.outputs.flag2 == 'true'
run: echo "flag2 is true"
```

The results of the flag evaluations are stored in the step outputs named with each flag's key.

### Available Options

| Parameter | Description | Required | Default |
| ---------------- | ---------------------------------------------------------------------------------------------------------- | ---------- | ------------------- |
| `sdk-key` | SDK key identifying the config to download, also loaded from the `CONFIGCAT_SDK_KEY` environment variable | | |
| `flag-keys` | List of feature flag keys to evaluate. Multiple values must be in separate lines. | &#9745; | |
| `user-attributes` | List of user attributes used for evaluation. Multiple values must be in separate lines in the following format: `<key>:<value>`. Dedicated User Object attributes are mapped like the following: Identifier => id, Email => email, Country => country. | | |
| `base-url` | The CDN base url from where the CLI will download the config JSON. | | ConfigCat CDN servers. |
| `data-governance` | Describes the location of your feature flag and setting data within the ConfigCat CDN. Possible values: `eu`, `global`. | | `global` |
| `verbose` | Turns on detailed logging. | | false |
6 changes: 3 additions & 3 deletions website/versioned_docs/version-V1/integrations/github.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
id: github
title: GitHub Action - Scan your code for feature flag usages
description: ConfigCat GitHub Action. This is a step-by-step guide on how to use the ConfigCat GitHub Action to eliminate tech debt in your project.
title: Scan your code for feature flag usages
description: This is a step-by-step guide on how to use the ConfigCat GitHub Action to eliminate tech debt in your project.
---

import CodeRefIntro from '/docs/advanced/code-references/\_intro.mdx'
import GitHubAction from '/docs/advanced/code-references/github-action.mdx'

<CodeRefIntro linkText="GitHub Action" linkUrl="https://github.com/marketplace/actions/configcat-scan-repository" linkTarget="_blank" />
<CodeRefIntro linkText="Scan Repository GitHub Action" linkUrl="https://github.com/marketplace/actions/configcat-scan-repository" linkTarget="_blank" />

[Here](../advanced/code-references/overview.mdx) you can find more details about how this feature works.

Expand Down
Loading
Loading