Elements Manual
Elements 3 Manual
Elements 3 Manual
  • Welcome 👋
  • QUICK START
    • Elements in Five Minutes or Less
    • Accessing the Web UI (CRM)
    • Creating A User
  • General
    • General Concepts
    • N-Tier Architecture
    • Security Model
  • Core Features
    • Core API Overview
    • Sessions
    • Applications
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Leaderboards
    • Matchmaking
    • Followers
    • Friends
    • Reward Issuance
    • Save Data
    • Schemas and Metadata Specifications
    • Queries
      • Base Query Syntax
      • Boolean Queries
      • Object Graph Navigation
      • Advanced Operators
        • .ref
        • .name
    • Custom Code
      • Element Structure
      • RESTful APIs
      • Websockets
    • Auth Schemes
      • OIDC
      • OAuth2
  • Web 3
    • Omni Chain Support
    • Vaults
    • Wallets
    • Smart Contracts
      • Smart Contracts: Ethereum
      • Smart Contracts: Flow
      • Smart Contracts: Solana
      • Smart Contracts: Neo
  • CONFIGURATION
    • Direct Database Access and Batch Configuration
    • Batch Samples
      • Item Upload Bash Script Sample
      • Mission Upload Bash Script Sample
  • RESTful APIs
    • Swagger and Swagger UI
    • API Specification
      • /application
      • /application/configuration
      • /auth
      • /auth_scheme
        • /custom
        • /oauth2
        • /oidc
      • /blockchain
      • /followee
      • /follower
      • /friend
      • /google
      • /index
      • /inventory
      • /item
      • /large_object
      • /leaderboard
      • /rank
      • /score
      • /match
      • /mission
      • /progress
      • /reward_issuance
      • /schedule
      • /notification
      • /profile
      • /save_data
      • /metadata_spec
      • /mock_session
      • /session
      • /health
      • /version
      • /signup
      • /user
    • Javadocs
  • Releases
    • 3.1 Release Notes
    • 3.2 Release Notes
Powered by GitBook
On this page
  • User Properties
  • Profile Properties
  1. Core Features

Users and Profiles

Elements fully supports Users and Profiles that allow users of your application or game to store their profile data and access a network of applications from a single login profile.

Elements uses a one-to-many model for the User / Profile relationship. A Profile is linked directly to both one single Application and one single User.

As Elements is a multi-tenant system, there can be many Applications that allow for many Profiles per Application.

This structure gives you the flexibility to create a network of Applications under the same roof, with any User level information, such as Inventory, accessible in every Application should you so choose.

User Properties

A User has the following properties:

  • id

  • name

  • email

  • level

    • UNPRIVILEGED - An unprivileged/anonymous user.

    • USER - A basic user.

    • SUPERUSER - An administrator/super user, who can do all of the above as well as delete/create users.

  • active - Inactive Users will not appear in searches made by non-superuser level users.

  • FacebookId

  • AppleSignInId

Managing Users in the Console

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

The "Add User" button will open the new user panel.

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

Passwords can be set or changed using the admin console as well. In the database, they are salted and hashed and can't be manipulated directly.

JSON Structure of Users

Here is a sample of a user JSON entry from the database:

{
    "_id" : ObjectId("5cdb0aa4e96c3c4f2bfe16ea"),
    "active" : true,
    "name" : "jsmith",
    "email" : "jsmith@elements.com",
    "level" : "SUPERUSER",
    "salt" : { "$binary" : "/thisissalt", "$type" : "00" },
    "passwordHash" : { "$binary" : "thisisapasswordhash=", "$type" : "00" },
    "hashAlgorithm" : "SHA-256"
}

Profile Properties

A Profile has the following properties:

  • Id

  • User - The User that this Profile is linked to.

  • Application - The Application that this Profile is linked to.

  • ImageUrl - Any associated avatar image.

  • DisplayName - The name that should be displayed on the client side.

  • Metadata - Key/Value store that can be modified.

  • LastLogin - The time that the current session token was created (MS since epoch)

Once created, only the DisplayName and ImageUrl can be modified from the client side (via ProfilesApi). However, other properties, such as the Metadata, can be modified from the server side.

Profile Metadata

As mentioned in the previous section, the Profile metadata is a key/value store for just about anything that you'd want to be publicly facing (as Inventory is private) in a Profile. This is a great place for storing info that you might want different Profiles to know about each other. For example, say you have a game where someone can earn points to increase a numeric rank. In order to see that information, it needs to be stored in a publicly accessible place. Take this wireframe image for example:

All of the stats listed in this screen would be housed by the Profile metadata, so the JSON representation might look something like this:

{
    "id" : <id string>, 
    "user" : <redacted>,
    "application" : <Application JSON>,
    "image_url" : <path to image>,
    "display_name" : <display name string>,
    "last_login" : <last login time>,
    "metadata": {
        "ranking" : 1300,
        "wins" : 999,
        "losses" : 999,
        "total_games" : 999,
        "current_win_streak" : 999,
        etc...
    }
}

Managing Profiles Using the Console

Profiles can be added, edited, or deleted from the admin console in the Profiles section, accessible from the top nav bar or the hamburger menu.

Since Profiles must be connected to a user, when making a new profile you can use the "Select User" button to find the user that will own this profile. If you are editing an existing profile, you can use the "Edit User" button to open the Edit User panel for that user. Existing profiles cannot be reassigned to another user.

When creating a new profile, you must also select an Application. A dropdown menu will open with the available applications. If editing an existing profile, the Application may not be changed.

JSON Structure of Profile

This is a sample profile represented in JSON:

[{
    "_id" : ObjectId("5cdb92e7e96c3c4f2b01106f"),
    "active" : true,
    "application" : {
        "$ref" : "application",
        "$id" : ObjectId("5cdb1088e96c3c4f2bfe1da7")
    },
    "user" : {
        "$ref" : "user",
        "$id" : ObjectId("5cdb92e5e96c3c4f2b0107ca")
    },
    "imageUrl" : "url/to/image",
    "displayName" : "DisplayName",
    "lastLogin" : ISODate("2019-05-15T04:17:47.127Z"),
    "metadata" : {
        "metadata_string" : "string"
        "metadata_int" : 1
    }
}]
PreviousApplicationsNextDigital Goods

Last updated 3 days ago

Profile metadata is edited identically to how item metadata is edited. See .

Add a new user
FBPanelExample
Profile Editor
Editing Item Metadata