{
    "componentChunkName": "component---src-templates-article-page-template-js",
    "path": "/references/assets/",
    "result": {"data":{"markdownRemark":{"frontmatter":{"title":"Assets","slug":"assets","updated":"2023-04-01T00:00:00.000Z","category":"references","ingress":"Reference documentation providing information on assets.","skills":null},"htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"Assets"}]},{"type":"text","value":" are a mechanism for defining client application configuration\ndata and content for a marketplace. The assets are managed by a\nmarketplace operator and changes relatively infrequently. Each "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"asset"}]},{"type":"text","value":"\nis an object that defines a "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"path"}]},{"type":"text","value":" and "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"content"}]},{"type":"text","value":". The path gives the\nasset a name and allows organizing assets in a way similar to a file\nsystem, where assets can be organized in directory-like structure. The\ncontent of the asset is its data in one of the supported data types."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"At present, Flex supports only JSON data as assets. Support for images\n(JPEG, PNG, etc) is coming in the future."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The assets are typically edited by a marketplace operator though Flex\nConsole."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"warning","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"All assets are considered public and must not be used to store secret or\notherwise sensitive information."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"At present, Flex uses assets for managing marketplace content without\ncode changes:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"you can modify "},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/microcopy/"},"children":[{"type":"text","value":"microcopy strings"}]},{"type":"text","value":" and"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"create content "},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/content-management/"},"children":[{"type":"text","value":"pages"}]},{"type":"text","value":" for your\nmarketplace"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"For example, a marketplace may have assets with the following assets:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"├── config\n│   └── client.json\n└── content\n    └── translations.json"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"where "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"config/client.json"}]},{"type":"text","value":" could contain configuration data (for\ninstance, UI colors, marketplace pricing settings, etc) and\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"content/translations.json"}]},{"type":"text","value":" could contain string microcopy data to be\nused in a marketplace client application (such as one based on one of\nthe FTW templates)."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"asset-versioning","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#asset-versioning","ariaLabel":"asset versioning permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Asset versioning"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Collectively, the set of assets of a marketplace is called the "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"asset\ntree"}]},{"type":"text","value":". Each time the data of one or more assets is changed, a new asset\nis added, or an existing asset is deleted, a new version of the asset\ntree is created. Old asset tree versions are never updated. In other\nwords, tree versions are immutable."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Each tree version, therefore, represents the exact set of assets and\ntheir data at the time when the version was created."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The following analogy with the Git version control system may be useful\nto consider: The asset tree versions are analogous to Git commit SHAs.\nThe entire asset tree is versioned as a whole and individual assets do\nnot have their own independent versions. Unlike Git, however, the asset\ntree versioning does not support branching."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To facilitate access to the latest asset data, Flex maintains a built-in\n"},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"alias"}]},{"type":"text","value":" called "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"latest"}]},{"type":"text","value":" that always refers to the latest asset tree\nversion."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Note:"}]},{"type":"text","value":" Old versions of the asset tree may be automatically deleted,\nbut no sooner than 24 hours after the version gets succeeded by a\nnewer one."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"retrieving-asset-data","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#retrieving-asset-data","ariaLabel":"retrieving asset data permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Retrieving asset data"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Client applications retrieve asset data through the\n"},{"type":"element","tagName":"a","properties":{"href":"https://www.sharetribe.com/api-reference/asset-delivery-api.html","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"Asset Delivery API"}]},{"type":"text","value":".\nAsset data can be access either by alias (using the built-in "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"latest"}]},{"type":"text","value":"\nalias) or by specific version."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In order to access asset data, clients need a client ID for a valid Flex\nMarketplace API application. The easiest way to access assets is by\nusing the\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/js-sdk/#flex-sdk-for-javascript"},"children":[{"type":"text","value":"Flex SDK for JavaScript"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"See the\n"},{"type":"element","tagName":"a","properties":{"href":"https://www.sharetribe.com/api-reference/asset-delivery-api.html","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"Asset Delivery API reference"}]},{"type":"text","value":"\nfor more information."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"asset-data-caching","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#asset-data-caching","ariaLabel":"asset data caching permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Asset data caching"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In order to ensure as efficient data retrieval as possible, the Asset\nDelivery API response data can be cached by both the Asset CDN and the\nclient. Each API response comes with appropriate "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Cache-Control"}]},{"type":"text","value":" and\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ETag"}]},{"type":"text","value":" HTTP headers automatically and caching works out of the box with\nclients that support these headers (such as the end users' web\nbrowsers)."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Since asset versions are immutable, asset data that is accessed by a\nspecific version can be cached for extended period of time. On the other\nhand, the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"latest"}]},{"type":"text","value":" alias is mutable and therefore asset data retrieved\nby alias cannot be cached indefinitely. The cache time for access by\nalias can differ depending on whether your marketplace environment is a\ndevelopment or live one. For live marketplaces the cache time can be up\nto 5 minutes, while for development marketplaces it is much lower. Refer\nto the\n"},{"type":"element","tagName":"a","properties":{"href":"https://www.sharetribe.com/api-reference/asset-delivery-api.html","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"Asset Delivery API reference"}]},{"type":"text","value":"\nfor up-to-date-information. The "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Cache-Control"}]},{"type":"text","value":" HTTP header will always\nprovide correct data and client applications should observe that if\ncustom caching is being implemented."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In live marketplaces, the latest asset data can be cached and it may\ntake up to 5 minutes before any changes are visible to all end users."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"further-reading","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#further-reading","ariaLabel":"further reading permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Further reading"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/microcopy/"},"children":[{"type":"text","value":"Editing client application microcopy"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/content-management/"},"children":[{"type":"text","value":"Managing asset-based marketplace content"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://www.sharetribe.com/api-reference/asset-delivery-api.html","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"Asset Delivery API reference"}]}]},{"type":"text","value":"\n"}]}],"data":{"quirksMode":false}},"headings":[{"value":"Asset versioning","depth":2},{"value":"Retrieving asset data","depth":2},{"value":"Asset data caching","depth":3},{"value":"Further reading","depth":2}]}},"pageContext":{"slug":"assets","category":"references"}},
    "staticQueryHashes": ["3794076007","439097193","717698143"]}