Authenticating with Your API Key

To use the Giftoin API, you need to authenticate using your API key. We've simplified this process by using a settings file within the GiftoinModule.

Steps to Set Up Authentication

  1. Locate the Settings File: In the GiftoinModule folder, you'll find a file named Settings.lua.

  2. Enter Your API Key: Open Settings.lua and look for the API_KEY variable. Replace the placeholder value with your actual API key:

    -- GiftoinSettings.lua
    local Settings = {
        API_KEY = nil -- Replace with your actual API key
    }
    
    return Settings
  3. Save the File: After entering your API key, save the Settings.lua file.

Using the API

With your API key set in the settings file, the Giftoin Module will automatically handle authentication for all API calls. You don't need to manually authenticate in your scripts.

To use the Giftoin API in your game scripts, simply require the module as usual:

local GiftoinApi = require(game.ReplicatedStorage.GiftoinModule.API)
local GiftoinUtils = require(game.ReplicatedStorage.GiftoinModule.Utils)
local GiftoinEvents = require(game.ReplicatedStorage.GiftoinModule.Events)


local claimGiftoinEvent = game.ReplicatedStorage.GiftoinModule.ClaimGiftoinEvent

claimGiftoinEvent.OnServerEvent:Connect(function(player)
-- Now you can use GiftoinAPI functions without additional authentication steps
	GiftoinApi.someFunction(player)
end)

Security Note

Remember to keep your GiftoinSettings.lua file secure and never share it publicly. If you're using version control, make sure to add this file to your .gitignore to prevent accidentally committing your API key.