LogoLogo
  • 🕴️ QUICK START GUIDE
  • DASHBOARD
    • Management
      • Add a new Game
        • Create a Game
        • Set-Up
        • Review Guidelines
      • Version control
        • Add a Build
        • Handle branches
        • Upgrade Versions
      • API Keys
    • NFT Collections
      • Add a Collection
      • Staking Support
    • Beta Codes
      • Create a Beta Code
    • Tournaments
      • Set Up
      • Create Tournament
    • In-App Purchases
      • Developer
        • Set up your Store
        • Submit Product
        • Client Integration
        • Handle Post-Payments
      • Payment Gateways
      • Review Guidelines
    • Elixir Invisible Wallet
      • Gas Manager
        • Create Gas Manager
        • Handle Balances
    • Reward Center
      • Game Quests
        • Add a Stat
        • Create a Quest
        • Test Your Quest
        • Submit your Quest
        • Update Progress
        • Review Guidelines
  • Elixir Gamer Services
    • 🏁Kick-off
    • Unity
      • Getting Started
        • Overview
        • Updates
          • GitHub
          • Unity Asset Store (Coming Soon)
      • Overlay
        • Overlay Actions
        • Event Simulator
          • SDK Events
      • Authentication
        • Desktop
        • Mobile
      • Reference
    • Unreal Engine
      • Getting Started
        • C++ Project
        • Blueprints Project
  • API
    • Elixir REST API
      • 🖥️Desktop Auth
      • 📱Mobile Auth
      • 🔐RSA Signature
        • 🔢C# Example
        • 🔢Node.js Example
      • 🧔User
      • 👾NFTs
      • 🏆Tournaments API
      • ❓Game Quests
    • How To
      • Link Elixir account to a game API account
Powered by GitBook
On this page
  • Step 1: Prepare Elixir
  • Step 2: Initialize Elixir

Was this helpful?

Export as PDF
  1. Elixir Gamer Services
  2. Unreal Engine
  3. Getting Started

C++ Project

This guide assumes you are implementing the Elixir SDK in a C++ project and have already cloned the Elixir SDK plugin into your "Plugins" folder.

PreviousGetting StartedNextBlueprints Project

Last updated 1 year ago

Was this helpful?

Step 1: Prepare Elixir

The first step to integrating Elixir is to assign your SDK public key by running:

UElixirSubsystem::GetInstance()->PrepareElixir(ElixirApiKey);

It is highly recommended to manage API keys through some sort of persisted settings system, such as the built in Unreal Engine UDeveloperSettings class, as you will find yourself having to frequently switch between development API keys for testing and production API keys for building a release.

Step 2: Initialize Elixir

The second step of Elixir integration is calling the InitElixir function. The function receives a UElixirSubsystem::FCallback.

UElixirSubsystem::FCallback CompleteCallback;
CompleteCallback.BindDynamic(this, &UMyClass::OnElixirInitComplete);
UElixirSubsystem::GetInstance()->InitElixir(CompleteCallback);

The completion callback can execute any logic that should happen after initializing the SDK:

void UMyClass::OnElixirInitComplete(const bool bSuccess)
{
    // this code will run after the SDK has either been successfully initialized
    // or an error has been encountered
}

It is advisable to initialize the SDK as early as possible in your game workflow

The initialization process will take care of the following:

  • Log in the user automatically via provided context from Elixir Launcher (in production) or a freshly generated token (in development).

  • Initialize connection to the Elixir Overlay event buffer

  • Set up a timer to refresh the authentication token automatically in the background

You are now ready to use the Elixir SDK!

Easily Add Custom 'Project Settings' to Unreal Engine (.INI)Tom Looman
Learn more about adding custom settings to Unreal Engine
Logo