Documentation Index
Fetch the complete documentation index at: https://trophy-mintlify-eb9158bd.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Multi-tenancy in Trophy is only available on request. Please get in touch to discuss your needs.
What is Multi-Tenancy?
Multi-tenancy in Trophy allows you to power gamification features on behalf of multiple of your own customers, and allow them to customize the gamification features they use in their own applications and how they work. Multi-tenancy is specifically designed for B2B SaaS platforms who want to offer gamification features as a service to their customers, but don’t have the time or resources available internally to build and maintain the gamification infrastructure themselves.How Does Multi-Tenancy Work?
Multi-tenancy works by creating ‘tenant’ records in Trophy for each of your customers, and configuring gamification features within the context of each tenant. Customers who use multi-tenancy then make use of the Admin API to build internal control panels that allow their customers to manage their own gamification features within the constraints you set for them. Similarly, customers who use multi-tenancy then make use of the Application API to power the UI that allows their customers’ end-users to see and interact with the gamification features they have exposed to them. In this way, you can power complex gamification features for your own customers, without building or maintaining any gamification infrastructure yourself, and critically whilst upholding your own brand.What Is A Tenant?
A tenant is a logical grouping of users and data that represent the gamification features that a single customer uses within a multi-tenant Trophy account.Tenant ID
Thetenant.id property is a unique identifier for each tenant that is used to scope API calls to a single customer.
You can use your existing internal ID for each tenant. You do not need to create a new ID for each tenant, as long as it is unique within your own system.
Delivering Multi-Tenant Gamification
There are two core components to delivering multi-tenant gamification: customer control panels and end-user UI. Here we walk through how Trophy can help you deliver both with minimal effort.Building Customer Control Panels
In order for customers to be able to manage their own gamification features, you need to provide them with a control panel within your own application that allows them to do so. This means providing screens and functionality to choose which features to use, plus all the necessary toggles and switches to customize how each feature works. Trophy’s Admin API allows you to completely manage any gamification feature available for configuration within the Trophy dashboard via headless API. This allows you to serve control panels to your customers that allow them to manage their own gamification features within the constraints that you decide to set for them. The only additional step required is to understand how to scope API calls from your control panel to the specific tenant that the customer belongs to. Read more about how to do this in the dedicated section on setting tenant scope.Powering End-User UI
The other critical part of delivering multi-tenant gamification is to power the UI that allows your customers’ end-users to see and interact with the gamification features your customers have exposed to them. The Application API is already purpose built for powering gamification features within any application, and the process for powering features for your customers’ end users is no different. The only extra step required is to understand how to scope API calls to the specific tenant that the end-user belongs to. Read more about how to do this in the dedicated section on setting tenant scope.Setting Tenant Scope
Both the Admin API and the Application API work the same way for single and multi-tenant accounts. You use the same client libraries to power gamification in both cases. The only difference is that when using either the admin or application API within a multi-tenant account, you need to pass theTenant-ID header to any API call that you want to scope to a specific tenant:
Sending a multi-tenant API call
tenantId parameter in all methods:
Frequently Asked Questions
How many tenants can I create?
How many tenants can I create?
Each Trophy account can have an unlimited number of tenants.
How do I set the tenant scope for an API call?
How do I set the tenant scope for an API call?
You can set the tenant scope for an API call by passing the
Tenant-ID header to any API call.