Setting Development Token

Setting Development Token

Integrating ChafKit into your game requires the CHAFKIT_TOKEN environment variable to be set. Since this variable is typically set when the game is launched via the Chaf Games Desktop Application, you need to manually set the environment variable during development testing.

To obtain and set the development token, follow the steps below:

  1. Refer to the previous section, "Enable Developer Mode," to enable developer mode in the Chaf Games Desktop Application. This will allow you to issue a ChafKit Development Token.

  2. Once developer mode is enabled, you can access the development token value as follows:

    • Copy the token value provided in the Chaf Games Desktop Application.
  3. Open the Command Prompt (CMD) by searching for "CMD" in the Start menu.

  4. Execute the following command in the Command Prompt:

    setx CHAFKIT_TOKEN <TOKEN>

    Replace <TOKEN> with the value you copied from the Chaf Games Desktop Application.

  5. After executing the command, restart the Game Engine editor or reboot your computer for the environment variable changes to take effect.

    If you are using Unreal Engine, you will also need to completely exit the Epic Games Launcher for the changes to apply.

  6. Once the token is set properly as the CHAFKIT_TOKEN environment variable, the ChafKit initialization will succeed when you launch your game. This allows you to test and utilize the ChafKit features within your development environment.

By following these steps and setting the development token as the CHAFKIT_TOKEN environment variable, you can ensure that ChafKit initializes correctly and is ready to be used during your game's development phase.