Giftoin Docs
  • 👋INTRODUCTION
    • Welcome to Giftoin
    • Overview
    • Quick Start
    • FAQs
    • Key Features
  • 🧩API REFERENCE
    • Standards and Conventions
    • Orders API
      • Tokens/Points
      • Collectibles/Cards
      • Collectibles/Random Cards
    • Users API
      • Inventory
      • Progress
    • Error Handling
  • 💻PLATFORM GUIDES
    • Roblox
      • Why use Giftoin?
      • Basic Usage
      • Developer Access
      • Installation
      • Additional Example / Use-Cases
        • Point Reward
        • Daily Reward
        • Advanced Point Distribution System
        • Managed Codes & In-Game Rewards (Coming Soon)
          • Registering Reward Types
      • Tools and Scripts
        • Rotating Script
        • Floating Script
        • Quest System (Coming Soon)
    • Discord
      • Introduction
      • Getting Started
      • Command Reference
      • Role System
      • User Guides
      • Troubleshooting
      • FAQs
    • Wordpress
  • 📚Resources
    • Use Cases
      • Basic
      • eCommerce
      • Games
    • Support
Powered by GitBook
On this page
  • File Structure
  • Authenticating with Your API Key

Was this helpful?

  1. PLATFORM GUIDES
  2. Roblox

Installation

PreviousDeveloper AccessNextAdditional Example / Use-Cases

Was this helpful?

To add the Giftoin Module to your Roblox game you need to simply download the module and import it to your game accordingly to the detailed guide below:

  1. Download Giftoin Module file:

    • Navigate to and select the downloaded .rbxmx file.

  2. Place in ServerScriptService:

    • Right click ServerScriptService in your Explorer panel.

    • Select "Insert Object"

    • Select the GiftoinModule file you just downloaded

    • The GiftoinModule folder & config will be imported to your ServerScriptService

  3. Create Additional Objects (optional) : Create multiple RemoteEvent in ReplicatedStorage as needed and mentioned in further guides in this docs.

Verifying Installation

Regardless of the method you choose, ensure that the Giftoin Module is properly placed in ServerScriptService. This location is crucial for the module to function correctly and securely.

File Structure

GiftoinModule (Folder)
├── init.lua
├── API.lua
├── Utils.lua
├── Events.lua
├── [Other module files]
GiftoinModuleConfig (File)

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 config file within the GiftoinModule.

Steps to Set Up Authentication

  1. Locate the Config File: In the ServerScriptFolder folder, you'll find a file named GiftoinModuleConfig. This file is outside of the GiftoinModule folder to enable you to upgrade to future versions easily without resetting your config each time.

  2. Enter Your API Key: Look for the API_KEY variable and replace the placeholder value with your actual API key:

    return {
    	API = {
    		BASE_URL = "https://api.giftoin.org/v1/api-reseller/api/v1",
    		API_KEY = "123"
    	},
    }
    
    
  3. Save the File: After entering your API key, save the 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 ServerScriptService = game:GetService("ServerScriptService")
local GiftoinModule = require(ServerScriptService:WaitForChild("GiftoinModule"):WaitForChild("init"))
local GiftoinEvents = GiftoinModule.Events




--local claimGiftoinEvent = game.ReplicatedStorage.GiftoinModule.ClaimGiftoinEvent
-- Create the ClaimGiftoinEvent if it doesn't exist
local claimGiftoinEvent = game.ReplicatedStorage:FindFirstChild("ClaimGiftoinEvent")
if not claimGiftoinEvent then
	claimGiftoinEvent = Instance.new("RemoteEvent")
	claimGiftoinEvent.Name = "ClaimGiftoinEvent"
	claimGiftoinEvent.Parent = game.ReplicatedStorage
end


claimGiftoinEvent.OnServerEvent:Connect(function(player)
	GiftoinEvents.claimDaily(player)
end)

Security Note

Remember to keep your GiftoinModuleConfig 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.

💻
7KB
v1.0.0.rbxm
Giftoin Module File