Developers - CLI and Themes
perfection.json
This local configuration file stores your credentials that will be used by any CLI commands. By creating this file, you don't have to pass apiKey
and subscription
flags with any CLI commands.
Files structure
This is where this file should be stored within your Perfection directory:
├── root
│ ├── perfection
│ │ ├── theme.json
│ │ ├── perfection.json
│ │ ├── components
│ │ │ ├── promo-bar.json
│ │ │ ├── hero-banner.json
│ │ │ ├── product-card.json
│ │ │ ├── ...
How to create this file
CLI command
The following CLI command will create or update your credentials in a locally stored configuration file. By default, this command will store the provided values in a perfection.json
file stored in the command execution folder.
The contents of the file will only contain the values of the flags provided.
Take below command as an example:
perfection config set --apiKey=YOUR_API_KEY --subscription=YOUR_SUBSCRIPTION_ID --baseUrl=API_ENDPOINT
This will result in below file:
{
"apiKey": "YOUR_API_KEY",
"subscription": "YOUR_SUBSCRIPTION_ID",
"baseUrl": "API_ENDPOINT" //Optional
}
Manual creation
You can also manually create this file. Please make sure it is sotred at the same level as your theme.json
file