Skip to content

Instantly share code, notes, and snippets.

@robwierzbowski
Last active February 22, 2022 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robwierzbowski/250c36c7028a6a2afe01bd3f74c36442 to your computer and use it in GitHub Desktop.
Save robwierzbowski/250c36c7028a6a2afe01bd3f74c36442 to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
{
"$ref": "#/definitions/{name:\"order\"|\"categories\"|\"exchange\"|\"freestyle\"|\"homefeed\"|\"post_checkout_promo\"|\"return\"|\"shopping_bag\"|\"storybook\";schema:\"screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";}"
},
{
"$ref": "#/definitions/{name:\"buy_it_again_index\"|\"category\"|\"collections_index\"|\"kept_items_index\"|\"saved_items_index\";schema:\"category_screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";category_id:string;}"
},
{
"$ref": "#/definitions/{name:\"category_set\";schema:\"category_set_screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";category_set_id:string;}"
},
{
"$ref": "#/definitions/{name:\"kept_item\"|\"pdp\";schema:\"sku_screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";sku_id:string;}"
}
],
"definitions": {
"{name:\"buy_it_again_index\"|\"category\"|\"collections_index\"|\"kept_items_index\"|\"saved_items_index\";schema:\"category_screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";category_id:string;}": {
"properties": {
"category_id": {
"description": "The UUID that represents the category.",
"type": "string"
},
"locale": {
"description": "The client's I18n value for localization.",
"enum": [
"en-GB",
"en-US"
],
"type": "string"
},
"name": {
"description": "A string that Algos and Product use to identify a distinct group of events. It does not contain information that is recorded by other fields (e.g., `type`, `schema`).\n\n`buy_it_again_index`: Displays previously purchased skus.\n`category`: Displays products from a single category.\n`collections_index`: Displays trending for you and complete your looks collections.\n`kept_items_index`: Displays freestyle and fix purchases.\n`saved_items_index'`: Displays skus the client has saved.",
"enum": [
"buy_it_again_index",
"category",
"collections_index",
"kept_items_index",
"saved_items_index"
],
"type": "string"
},
"region": {
"description": "The identifier for the regional variation of the application that the client is viewing.",
"enum": [
"UK",
"US"
],
"type": "string"
},
"schema": {
"description": "A string that describes the shape the event conforms to.",
"enum": [
"category_screen_view"
],
"type": "string"
},
"source_app": {
"description": "The fixops name of the application that emitted the event.",
"enum": [
"android",
"home-ui",
"kept-items-ui",
"shop-collections-ui",
"storybook"
],
"type": "string"
}
},
"required": [
"category_id",
"locale",
"name",
"region",
"schema",
"source_app"
],
"type": "object"
},
"{name:\"category_set\";schema:\"category_set_screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";category_set_id:string;}": {
"properties": {
"category_set_id": {
"description": "The slug that represents the category set.\n\nExample: `'departments'`.",
"type": "string"
},
"locale": {
"description": "The client's I18n value for localization.",
"enum": [
"en-GB",
"en-US"
],
"type": "string"
},
"name": {
"description": "A string that Algos and Product use to identify a distinct group of events. It does not contain information that is recorded by other fields (e.g., `type`, `schema`).\n\n`category_set`: Displays categories in a category set (e.g., departments or brands).",
"enum": [
"category_set"
],
"type": "string"
},
"region": {
"description": "The identifier for the regional variation of the application that the client is viewing.",
"enum": [
"UK",
"US"
],
"type": "string"
},
"schema": {
"description": "A string that describes the shape the event conforms to.",
"enum": [
"category_set_screen_view"
],
"type": "string"
},
"source_app": {
"description": "The fixops name of the application that emitted the event.",
"enum": [
"android",
"home-ui",
"kept-items-ui",
"shop-collections-ui",
"storybook"
],
"type": "string"
}
},
"required": [
"category_set_id",
"locale",
"name",
"region",
"schema",
"source_app"
],
"type": "object"
},
"{name:\"kept_item\"|\"pdp\";schema:\"sku_screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";sku_id:string;}": {
"properties": {
"locale": {
"description": "The client's I18n value for localization.",
"enum": [
"en-GB",
"en-US"
],
"type": "string"
},
"name": {
"description": "A string that Algos and Product use to identify a distinct group of events. It does not contain information that is recorded by other fields (e.g., `type`, `schema`).\n\n`kept_item`: Displays a details screen for a purchased (or kept) SKU, where the client can manage exchanges, refunds, and feedback.\n`pdp`: Displays a product details screen.",
"enum": [
"kept_item",
"pdp"
],
"type": "string"
},
"region": {
"description": "The identifier for the regional variation of the application that the client is viewing.",
"enum": [
"UK",
"US"
],
"type": "string"
},
"schema": {
"description": "A string that describes the shape the event conforms to.",
"enum": [
"sku_screen_view"
],
"type": "string"
},
"sku_id": {
"description": "The id that represents the SKU.",
"type": "string"
},
"source_app": {
"description": "The fixops name of the application that emitted the event.",
"enum": [
"android",
"home-ui",
"kept-items-ui",
"shop-collections-ui",
"storybook"
],
"type": "string"
}
},
"required": [
"locale",
"name",
"region",
"schema",
"sku_id",
"source_app"
],
"type": "object"
},
"{name:\"order\"|\"categories\"|\"exchange\"|\"freestyle\"|\"homefeed\"|\"post_checkout_promo\"|\"return\"|\"shopping_bag\"|\"storybook\";schema:\"screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";}": {
"properties": {
"locale": {
"description": "The client's I18n value for localization.",
"enum": [
"en-GB",
"en-US"
],
"type": "string"
},
"name": {
"description": "A string that Algos and Product use to identify a distinct group of events. It does not contain information that is recorded by other fields (e.g., `type`, `schema`).\n\n`categories`: Displays a list of recommended freestyle categories for the client.\n`exchange`: Displays exchangeable purchases.\n`freestyle`: Top level Freestyle screen.\n`homefeed`: Top level client home feed.\n`order`: Displays previous orders.\n`post_checkout_promo`: Displays promotions after checkout completes.\n`return`: Displays returnable purchases.\n`shopping_bag'`: Displays the client's shopping bag.\n`storybook'`: Used for local storybook development.",
"enum": [
"categories",
"exchange",
"freestyle",
"homefeed",
"order",
"post_checkout_promo",
"return",
"shopping_bag",
"storybook"
],
"type": "string"
},
"region": {
"description": "The identifier for the regional variation of the application that the client is viewing.",
"enum": [
"UK",
"US"
],
"type": "string"
},
"schema": {
"description": "A string that describes the shape the event conforms to.",
"enum": [
"screen_view"
],
"type": "string"
},
"source_app": {
"description": "The fixops name of the application that emitted the event.",
"enum": [
"android",
"home-ui",
"kept-items-ui",
"shop-collections-ui",
"storybook"
],
"type": "string"
}
},
"required": [
"locale",
"name",
"region",
"schema",
"source_app"
],
"type": "object"
}
},
"description": "__`useScreenViewEvent`__ is used to record that a client is loading a \"screen\" (usually a route on web, and a full-screen view on native). This event also gives user and platform context to all children events on the screen. Screen view events should be instrumented at the top of the React tree, and contain the header and footer components.\n\nExample:\n```\nimport { useScreenViewEvent } from '@stitch-fix/event-reporter';\nimport App from './App';\n\nconst Root = ({ children }: PageComponentProps) => {\n const { EventProvider } = useScreenViewEvent({\n locale: 'en-US',\n name: 'storybook',\n region: 'US',\n schema: 'screen_view',\n source_app: 'storybook',\n });\n\n return <EventProvider><App /></EventProvider>;\n};\n```"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment