create api-key
Learn how to create an API key.
This command creates an API key for your application. You can specify the name, permissions, and environment for the key.
Usage
This command has the following syntax:
croct create api-key <options>Example
Create an API key interactively:
npm
npx croct@latest create api-keyCreate a named API key for the production environment with specific permissions and copy it to the clipboard:
npm
npx croct@latest create api-key --name "My API Key" --env prod --permissions resource_read_access,token_issue --copyOptions
Besides the global options, this command accepts the following options:
- --name(optional)string
The name of the API key.
- --permissions(optional)string
A comma-separated list of permissions to grant to the API key.
Permission Description resource_read_access Allows reading resources such as content and slots. token_issue Allows issuing authentication tokens. data_export Allows exporting analytics and event data. - --env(optional)string
The environment of the API key.
The accepted values are prod and dev.
- --copy, -c(optional)boolean
Copy the API key to the clipboard.