Managing environment variables
There are two ways to manage environment variables in PartyKit.
Deploying secrets to PartyKit
PartyKit can store your appโs secrets. To do so, run the following command in your project directory (here we assume that the variable name is API_KEY
):
PartyKit will then prompt you to provide value of the variable.
If you wish to persist more than one variable, repeat the process.
Since variables will take effect only in the next deployment, run the following command:
Setting secrets per deployment
In case youโd like to set additional secrets for an individual deployment (or if you prefer to manage secrets yourself, for example in your CI environment), you can define the secrets in the .env
in the PartyKit directory.
Next, use the following command:
Please note that this command will take precedence over any previously deployed secrets, overriding their values for this particular deployment.
If you are not using .env
file, you can specify the variable values by using the following command (here we assume that we are deploying two variables: API_KEY
and HOST
, which correspond to your variables which were set locally):