Slots

Slots group assets by function to help apps know how to use the asset. Slots are used to create new Expressions and Collections, to customize sharing assets through permissions, and more.

Why Use Slots?

Imagine a simple dress-up game that uses assets for clothing items. We can group clothes into a few categories - hats, glasses, shirts, pants, and shoes. While this isn't an exhaustive list, these categories are clearly distinct. If a piece of clothing is a hat, it isn't a shoe.

If you were building this game using Asset Layer, we'd recommend creating a slot for each category of clothes. If I create a collection of tennis shoe assets, that collection should be a part of the shoe slot. If the collection is of baseball caps, then the collection should be a part of the hat slot. By grouping your assets by function using slots, it is much easier to share these assets across apps. Our tools make use of slots today, and we will increasingly utilize the slot as a fundamental building block for apps using Asset Layer.

Interoperability With Slots

Slots become the basis for interoperability of assets between apps. Slots are created as a part of a specific app, but apps can also add slots from other apps. A slot owner is the app which created a given slot. A foreign slot is a slot that has been added to your app which wasn't created by your app. Adding a foreign slot requires permission from the slot owner. For more details about permissions, see Auth + Permissions page.

When you add a foreign slot to your app, you get access to assets which occupy that slot. Because slots group assets by function, you should be able to use any asset in that slot in a predictable way. It is the responsibility of slot owners to manage their slots effectively and to only approve collections of assets which meet the requirements of a slot.

Slot Data Model

  • slotId: a UUID for the slot

  • slotName: a name for the slot

  • slotImage: a url for a 300x300 image used to represent the slot in menus

  • description: a text description of the slot

  • appId: the app that created the slot

  • acceptingCollections: true if the slot is accepting collection submissions from third parties

  • isPublic: true if the slot can be shared with other apps

  • collectionTypes: specifies which collection types can be contained in the slot. Can be "both", "unique", or "identical"

  • createdAt: date-time when the app was created

  • updatedAt: date-time when the app was last updated

  • collections : an array of collectionIds that are a part of the slot (see Assets + Collectionsfor details)

  • expressions: an array of expressionIds that are a part of the slot (see Expressions for details)

Example Slot Data

"slotId": "63d27479d8a5442e2f05746e",
"slotName": "TestSlot",
"slotImage": "https://asset-api-files-bucket.s3.amazonaws.com/8e4a0672-ef18-4e42-90d2-fc58a4bcb799.png",
"description": "test description",
"appId": "63d27445d8a544d641056b37",
"acceptingCollections": false,
"isPublic": true,
"collectionTypes": "unique",
"createdAt": 1674736761473,
"updatedAt": 1674736770540,
"collections": ["64be8a60616a24971532d172",
                "64bfda7fc32ada6ec09db25b"],
"expressions": ["63d27479d8a544dfef057471"]

Last updated