Elements Manual
Elements 2 Manual
Elements 2 Manual
  • Welcome 👋
  • QUICK START
    • Elements in Five Minutes or Less
  • General
    • General Concepts
    • N-Tier Architecture
    • Security Model
  • SCRIPTING ENGINE
    • Scripting Engine Overview
      • Intro to Resources and Cloud Functions
      • Horizontal Scaling Model
      • Database Access
      • Server-to-Server API Calls
      • Deploy Cloud Functions via Git
      • Creating and Destroying Resources
      • Cross-Resource Invocation
      • Indexing Resources
      • Coroutines
      • Manifest
  • Core Features
    • Core API Overview
    • Sessions
    • Applications
      • Facebook Application Configuration
      • Firebase Application Configuration
      • Amazon GameOn Application Configuration
      • iOS Application Configuration
      • Android Application Configuration
      • Matchmaking Application Configuration [deprecated]
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Leaderboards
    • Matchmaking
    • Followers
    • Friends
    • Reward Issuance
    • Push Notifications
    • Auth Schemes
    • Save Data
    • Schemas and Metadata Specifications
    • Queries
      • Base Query Syntax
      • Boolean Queries
      • Object Graph Navigation
      • Advanced Operators
        • .ref
        • .name
  • Web 3
    • Omni Chain Support
    • Vaults
    • Wallets
    • Smart Contracts
      • Smart Contracts: Ethereum
      • Smart Contracts: Flow
      • Smart Contracts: Solana
      • Smart Contracts: Neo
    • Know Your Customer
      • Formidium
  • CONFIGURATION
    • Using the Web Console
    • iOS and Android Product Bundles
    • Direct Database Access and Batch Configuration
  • UNITY PLUG-INS
    • Unity Plugin
    • Content Delivery Management and Unity CDN Plugin
  • DEPLOYMENT
    • Deployment Overview
      • Docker Containers
      • AWS Deployment
      • Standalone docker-compose
  • LUA SAMPLES
    • lua Samples
      • main.lua
      • event.lua
      • hello_world.lua
      • model.lua
      • startup.lua
      • HTTP Manifest
        • Example endpoint handler
        • Example operations table
  • RESTful APIs
    • Swagger and Swagger UI
    • Elements 3.0.X (Preview)
      • Applications
      • Friends and Followers
      • Digital Goods and Inventory
      • Leaderboards
      • Missions and Rewards
      • User and Profiles
      • Save Data
      • Custom Metadata
Powered by GitBook
On this page
  • Items
  • Inventory
  • Managing Items using the Console
  1. Core Features

Digital Goods

Elements fully supports Digital Goods, which are items that can be owned by users in their inventory or purchased with In-App Purchases, such as potions or gold coins in a video game.

PreviousUsers and ProfilesNextProgress and Missions

Last updated 2 years ago

Elements supports traditional Web 2.0 digital goods. Digital goods are items that can be owned by a user in their inventory. User inventories are independent of applications. Examples of digital goods may be consumable items such as potions or gold coins in a video game. Alternatively, they may be part of equipment sets such as swords, helmets, or weapon skins.

Digital goods are not limited to games and can be used to represent other content such as boosts in a dating app. Essentially, digital goods can be used to represent any type of content in an application that can be bought directly from your business.

The Digital Goods system in Elements manages three things:

  • Items represent the core metadata of the items offered for sale.

  • Inventory entries provide the association between a user and the Item they own.

  • Purchase Verification ties In-App Purchases to specific Items and Quantities which Elements will deposit upon successful validation of purchases tied to IAP bundles

Elements can verify purchases for Apple App Store and Google Play applications. First, you must set up for or and then add the relevant info for your app to Elements to interact with the App Store or Google Play.

Items

Items are digital goods in the Elements database. These exist independent of , so any application in your instance can interact with any item. Core APIs allow for the reading of items for sale.

These are the various fields that make up an item.

  • name: This is a string representing the name of your item. It must be unique and have no spaces.

  • tags: You may include a list of tags, as strings. Tags are an easy way to search for groups of items or sort them in your applications.

  • displayName: This is a string representing your item's display name.

  • description: This is a string that serves as a description for your item. Client code may opt to show this directly to the user.

  • metadata: Metadata is optional. It can be any number of named strings or integers. This can have many uses, for example secondary descriptions, asset paths, types, or any arbitrary values assigned to your item.

  • Category: Describes one of two particular inventory item values: and .

  • _id: In the database, the item will also have an _id field. This is automatically generated when the item is created and serves as an internal reference for that item.

Inventory

Inventory is tied to each user, listing the items that user owns and the quantity. A user's inventory is accessible across all applications. Once an Item exists, you may use Cloud Functions to assign inventory items to users in the system. Additionally, you may use SUPERUSER APIs to award items to users for administrative purposes.

Fungible Inventory Item

Fungible inventory items exist as stacks in the user's inventory. Common examples for fungible items may be coins or potions in a game, credits for something else redeemable, or simply points accrued for playing a game.

Fungible, in this context, is not related to the web3 concept of fungibility.

Distinct Inventory Item

Distinct inventory items exist as single objects in the database. Unlike Fungible items, Distinct items may exist in multiples in the inventory. Additionally, they are not stackable. Distinct items would be useful to represent digital goods such as a sword, gun, or other in-game inventory item. In addition to the base Metadata, Distinct Inventory Items have their own metadata. This is useful, for example, if your game has degradation logic for particular items. For example, a sword will eventually wear out until it needs repair.

Managing Items using the Console

Items are managed in the Digital Goods section of the admin console, which can be accessed from the upper nav bar or in the hamburger menu.

The "Add Item" button will open the new item panel.

Items can be edited by tapping the "Edit" button next to that item, or can be deleted by tapping the "Delete" button. Use the search function to more easily find specific items.

Editing Item Metadata

There are two ways to edit metadata on items.

The first is by adding a key and value then tapping the "+" button. Likewise, metadata can be deleted by tapping the "-" button.

You can also select "Advanced..." to switch to the advanced metadata editor, where you can edit metadata directly in a JSON format.

JSON Structure of Items

This is a sample item represented in JSON:

[{
        "name": "name",
        "tags": ["tag1","tag2"],
        "displayName": "Display Name",
        "description": "This is a description.",
        "metadata": {
            "metadata_string": "This is a string",
            "metadata_int": 1
        }
}]

The _id field is not included in the above sample. If you were to use a script to batch upload/update items, your JSON would look like this.

See below for more details about how to manage and modify items.

Fungible items exist at he USER level only and will be visible to all applications within Elements. See scoping rules for more details.

Application
Managing Items
iOS
Android
Applications
Fungible
Distinct
Application Configurations
Item Editor
Item Editor