This document outlines the steps required to test out the Early Access use case in our demo project. Early Access is a use case that allows select users to access and test new features before they are fully released.
Before implementing the Early Access use case, ensure you have:
- Followed the installation instructions from the main README.md
- Created an account on devcycle.com
- Created an account on Auth0.com
Follow the steps below to implement the Early Access use case in our demo React app:
Get Your Application Keys
- When you signed up for Auth0, a new application was created for you, or you could have created a new one. You will need some details about that application to communicate with Auth0. You can get these details from the Application Settings section in the Auth0 dashboard.
Add keys to .env.local file
- In the root directory of your project copy the .env.local.example file to .env.local and add the following environment variables:
AUTH0_SECRET='use [openssl rand -hex 32] to generate a 32 bytes value'
AUTH0_BASE_URL='http://localhost:3000'
AUTH0_ISSUER_BASE_URL='https://{yourDomain}'
AUTH0_CLIENT_ID='{yourClientId}'
AUTH0_CLIENT_SECRET='{yourClientSecret}'
Create Sample Users
- Create three different users in your Auth0 tenant by visiting the User Management section in the Auth0 dashboard.
Create a New Project
- In the DevCycle Dashboard, create a new project. Name the project some variation of Use Cases
Create a New Feature
- In this new project, create a new
Release
feature (boolean) and name it early-access
Create Targeting Rules
- In the
Users & Targeting
rules for your Development environment, create three targeting rules (in order):- Developers: set initial serve value to Variation On
- Beta Users: set initial serve value to Variation Off
- All Users: set initial serve value to Variation Off
Add SDK key to .env file
- Select the key icon (View API Keys) in the main navbar, and copy the client key for your Development Environment (it should look like dvcclient****)
- In the root directory of your project copy the .env.example file to .env and update it with the following environment variable:
NEXT_PUBLIC_DVC_SDK_KEY='{dvc_client_****}'
- Ensure your demo application is running at https://localhost:3000 by following the instructions in the main README.md file.
- Login as developer@domain1.com using the credentials you created in Step 1, and select the context menu by clicking on your profile image.
- If the DevCycle SDK has been successfully configured you should see the
Profile
menu item.
- If the DevCycle SDK has been successfully configured you should see the
- Now Login as beta@domain2.com using the credentials you created in Step 1, and select the context menu by clicking on your profile image.
- If targetting rules have been successfully configured you should not be able to see the
Profile
menu item.
- If targetting rules have been successfully configured you should not be able to see the
- Update the targetting rule for beta users by changing the serve value to
Variation On
- Refresh your demo app at http://localhost:3000 and the
Profile
menu item should now be visible
- Refresh your demo app at http://localhost:3000 and the
- Repeat the above process for user@domain2.com
- The Early Access feature flag can also be managed via the DevCycle CLI.
- Please refer back to the main README.md file for general instructions and contact information if any problems are encountered.