Complete the prerequisites
This topic contains instructions for completing the prerequisites, if you haven't done so already, for creating Feature Flags:
- Create a project
- Create an environment
- Create an SDK key
Before you can create a Feature Flag, you need to create a project in the Harness platform. A Feature Flag is available only for the project the flag is created in, so you need to create any flags in each project you want to use them for.
This topic describes how to create a project in the Harness Platform. For more information, go to Harness Platform documentation.
Before you create a Feature Flag, you must have created an Organization. It's also useful to know about how Access Control works in Harness, to learn more about this, go to Manage Access Control.
Create a project
In Harness, click Feature Flags and click Create Project.
In About the Project, in Name, enter the name for your project and select a color for it.
In the Organization drop-down menu, select the Organization for your project. If you need to create a new Organization, go to Create a Harness Organization and Organizations and Projects.
Click Save and Continue.
(Optional) In Invite Collaborators, in Invite People to Collaborate, add team members to the project.
(Optional) Assign a role to the collaborators and click Add. The roles you can select are:
- Project Viewer
- Project Admin
- Pipeline Executer
- Gitops Admin Role
- Feature Flag Manage Role
For more information about the permissions for each role, go to Manage Access Control and Permissions Reference.
Click Save and Continue. Your project is created.
In your project, click Feature Flags.
Create an environment
Once you've created a project, you need to create an environment before you create a Feature Flag. Feature Flags can be used independently across multiple environments within a single project, for example:
- In Project X you have two environments,
Environment_A
andEnvironment_B
. - You create
Flag_1
. - In
Environment_A
you could haveFlag_1
toggledon
, but inEnvironment_B
,Flag_1
is toggledoff
.
This topic describes how to create an environment in the Harness platform.
To read more about the Harness Platform, see Harness Platform.
Before you begin
Before you create a Feature Flag, you must have:
Create an environment
In your project, in Environments, click Create an Environment.
Enter a Name for your environment.
Harness generates a unique identifier for names. For details and restrictions, go to Entity Identifier Reference.
Select the Environment type and click Create.
Your environment is created and you can find it listed in Environments.
Create an SDK Key
After you’ve created your environment, you need to create an SDK key for it. You need to use this SDK key in your application’s code to authenticate your connection to the Harness Feature Flag client.
You can view and copy the SDK key only immediately after it is created. For security, after you leave the page, the key is redacted and you can’t view it. Make sure you make a copy of the key to use in your application.
To create an SDK key:
In the environment you created, in Settings, click Create SDK Key.
In Create SDK Key, in Name, enter a name for your SDK key.
In Key Type, select either Client or Server depending on the type of SDK you want to use. For more information about the SDK types Harness supports, go to Chose a Client-side or Server-side SDK. If your organization needs to rotate the keys, you can choose to add more than one key for the same environment.
Click Create.
Copy and store your Secret.
noteYou can only view and copy the SDK key immediately after it is created. For security, after you leave the page, the key is redacted and you can’t view it. Make sure you make a copy of the key to use in your application.