In general, use an API key with minimal permissions, just enough to run the commands you want to run.
For more information, see API keys.
Environment variables
Set these environment variables:ALGOLIA_APPLICATION_IDALGOLIA_API_KEY
Command-line options
Provide these options when running commands:--application-id--api-key
Profiles
Store your application ID and API key under a friendly name. Instead of providing the command-line options with every command, you can refer to the profile with the--profile option.
For example: algolia index list -p PROFILE_NAME.
For more information, see algolia profile add.
Profiles are stored in plain-text in the file
~/.config/algolia/config.toml.
If you manage your configuration files (“dotfiles”) with GitHub,
don’t commit this file.--profile option when using the default profile.
To change the default profile, see algolia profile setdefault.
Crawler commands
Crawler commands require different credentials: a Crawler user ID, and a Crawler API key. You can find them in the Algolia dashboard:- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Data sources.
- Select Crawler and go to the Settings tab.
Environment variables
Export your Algolia Crawler user ID and Crawler API key as environment variables:ALGOLIA_CRAWLER_USER_ID
and ALGOLIA_CRAWLER_API_KEY.
Profiles
Add the keyscrawler_user_id and crawler_api_key
to an application profile in ~/.config/algolia/config.toml.
An example profile for an Algolia application with Crawler
could look like the following: