@xyd-js/apidocs-demo 0.0.0-build-9ed88cf-20250813152233 → 0.0.0-build-6d91046-20250813172449

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,25 +1,25 @@
1
1
  # @xyd-js/apidocs-demo
2
2
 
3
- ## 0.0.0-build-9ed88cf-20250813152233
3
+ ## 0.0.0-build-6d91046-20250813172449
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies
8
- - @xyd-js/atlas@0.0.0-build-9ed88cf-20250813152233
9
- - @xyd-js/components@0.0.0-build-9ed88cf-20250813152233
10
- - @xyd-js/core@0.0.0-build-9ed88cf-20250813152233
11
- - @xyd-js/framework@0.0.0-build-9ed88cf-20250813152233
12
- - @xyd-js/gql@0.0.0-build-9ed88cf-20250813152233
13
- - @xyd-js/openapi@0.0.0-build-9ed88cf-20250813152233
14
- - @xyd-js/theme-cosmo@0.0.0-build-9ed88cf-20250813152233
15
- - @xyd-js/theme-gusto@0.0.0-build-9ed88cf-20250813152233
16
- - @xyd-js/theme-opener@0.0.0-build-9ed88cf-20250813152233
17
- - @xyd-js/theme-picasso@0.0.0-build-9ed88cf-20250813152233
18
- - @xyd-js/theme-poetry@0.0.0-build-9ed88cf-20250813152233
19
- - @xyd-js/theme-solar@0.0.0-build-9ed88cf-20250813152233
20
- - @xyd-js/themes@0.0.0-build-9ed88cf-20250813152233
21
- - @xyd-js/ui@0.0.0-build-9ed88cf-20250813152233
22
- - @xyd-js/uniform@0.0.0-build-9ed88cf-20250813152233
8
+ - @xyd-js/atlas@0.0.0-build-6d91046-20250813172449
9
+ - @xyd-js/components@0.0.0-build-6d91046-20250813172449
10
+ - @xyd-js/core@0.0.0-build-6d91046-20250813172449
11
+ - @xyd-js/framework@0.0.0-build-6d91046-20250813172449
12
+ - @xyd-js/gql@0.0.0-build-6d91046-20250813172449
13
+ - @xyd-js/openapi@0.0.0-build-6d91046-20250813172449
14
+ - @xyd-js/theme-cosmo@0.0.0-build-6d91046-20250813172449
15
+ - @xyd-js/theme-gusto@0.0.0-build-6d91046-20250813172449
16
+ - @xyd-js/theme-opener@0.0.0-build-6d91046-20250813172449
17
+ - @xyd-js/theme-picasso@0.0.0-build-6d91046-20250813172449
18
+ - @xyd-js/theme-poetry@0.0.0-build-6d91046-20250813172449
19
+ - @xyd-js/theme-solar@0.0.0-build-6d91046-20250813172449
20
+ - @xyd-js/themes@0.0.0-build-6d91046-20250813172449
21
+ - @xyd-js/ui@0.0.0-build-6d91046-20250813172449
22
+ - @xyd-js/uniform@0.0.0-build-6d91046-20250813172449
23
23
 
24
24
  ## 0.0.0-true-20250812233459
25
25
 
package/app/index.css CHANGED
@@ -14,7 +14,7 @@
14
14
  /* FIX IMPORANT */
15
15
  xyd-layout-primary {
16
16
  [part=sidebar], atlas-apiref-samples {
17
- top: 50px !important;
17
+ top: 65px !important;
18
18
  }
19
19
  }
20
20
 
@@ -29,7 +29,7 @@ xyd-layout-primary > header {
29
29
  display: none
30
30
  }
31
31
  xyd-layout-primary > main {
32
- top: 100px
32
+ top: 65px
33
33
  }
34
34
 
35
35
  .banner-container {
package/app/root.tsx CHANGED
@@ -30,21 +30,21 @@ export const links: Route.LinksFunction = () => {
30
30
 
31
31
  switch (SETTINGS?.theme?.name) {
32
32
  case "poetry":
33
- links.push({ rel: "stylesheet", href: poetryCss });
33
+ links.push({ rel: "stylesheet", href: poetryCss, "data-theme-style": "true" });
34
34
  break;
35
35
  case "opener":
36
- links.push({ rel: "stylesheet", href: openerCss });
36
+ links.push({ rel: "stylesheet", href: openerCss, "data-theme-style": "true" });
37
37
  break;
38
38
  case "cosmo":
39
- links.push({ rel: "stylesheet", href: cosmoCss });
39
+ links.push({ rel: "stylesheet", href: cosmoCss, "data-theme-style": "true" });
40
40
  break;
41
41
  case "picasso":
42
- links.push({ rel: "stylesheet", href: picassoCss, "data-xyd-theme-default": "true" });
42
+ links.push({ rel: "stylesheet", href: picassoCss, "data-theme-style": "true" });
43
43
  case "gusto":
44
- links.push({ rel: "stylesheet", href: gustoCss });
44
+ links.push({ rel: "stylesheet", href: gustoCss, "data-theme-style": "true" });
45
45
  break;
46
46
  case "solar":
47
- links.push({ rel: "stylesheet", href: solarCss });
47
+ links.push({ rel: "stylesheet", href: solarCss, "data-theme-style": "true" });
48
48
  break;
49
49
  }
50
50
 
@@ -9,6 +9,9 @@ import {
9
9
  import { Box, Button, Dropdown, Flex, TextField, Text, Spinner, FixedZIndex } from 'gestalt';
10
10
  import GitHubButton from 'react-github-btn'
11
11
 
12
+ import { UXNode } from "openux-js";
13
+
14
+
12
15
  import { Badge } from "@xyd-js/components/writer"
13
16
  import { ReactContent } from "@xyd-js/components/content";
14
17
  import { Atlas, AtlasContext, type VariantToggleConfig } from "@xyd-js/atlas";
@@ -20,6 +23,8 @@ import ThemeCosmo from "@xyd-js/theme-cosmo";
20
23
  import ThemePicasso from "@xyd-js/theme-picasso";
21
24
  import ThemeGusto from "@xyd-js/theme-gusto";
22
25
  import ThemeSolar from "@xyd-js/theme-solar";
26
+ import { Analytics, useAnalytics } from "@xyd-js/analytics";
27
+ import { SearchButton } from "@xyd-js/components/system"
23
28
 
24
29
  import poetryCss from '@xyd-js/theme-poetry/index.css?url';
25
30
  import openerCss from '@xyd-js/theme-opener/index.css?url';
@@ -68,8 +73,22 @@ const reactContent = new ReactContent(SETTINGS, {
68
73
  useNavigate,
69
74
  useNavigation
70
75
  })
76
+
77
+ let cloneSettings: any = null
78
+
79
+ if (!cloneSettings) {
80
+ if (globalThis.__xydSettingsClone) {
81
+ cloneSettings = globalThis.__xydSettingsClone
82
+ } else {
83
+ cloneSettings = JSON.parse(JSON.stringify(SETTINGS))
84
+ }
85
+ }
86
+
71
87
  // TODO: !!! for demo it cannot be globalThis cuz its globally for whole server !!!
72
88
  globalThis.__xydThemeSettings = SETTINGS?.theme
89
+ globalThis.__xydSettingsClone = cloneSettings
90
+ globalThis.__xydNavigation = SETTINGS?.navigation
91
+ globalThis.__xydWebeditor = SETTINGS?.webeditor
73
92
  globalThis.__xydReactContent = reactContent
74
93
  globalThis.__xydSurfaces = surfaces
75
94
 
@@ -88,7 +107,7 @@ switch (SETTINGS?.theme?.name) {
88
107
  case "picasso":
89
108
  theme = new ThemePicasso()
90
109
  break
91
- case "gusto":
110
+ case "gusto":
92
111
  theme = new ThemeGusto()
93
112
  break
94
113
  case "solar":
@@ -122,7 +141,8 @@ export async function loader() {
122
141
  return {
123
142
  defaultExample: await toUniform(
124
143
  "/docs/api",
125
- "https://raw.githubusercontent.com/livesession/livesession-openapi/master/openapi.yaml",
144
+ // "https://raw.githubusercontent.com/livesession/livesession-openapi/master/openapi.yaml",
145
+ `${import.meta.env.APP_URL || process?.env?.APP_URL || 'http://localhost:5173'}/livesession-openapi.yaml`,
126
146
  "",
127
147
  ""
128
148
  ),
@@ -222,34 +242,46 @@ const Layout2 = React.memo(function Layout2({
222
242
  ];
223
243
  }
224
244
 
225
- return <Framework
226
- settings={effectiveActionData.settings || {}}
227
- sidebarGroups={effectiveActionData.groups || []}
228
- metadata={{
229
- layout: "wide",
230
- uniform: "1",
231
- title: "OpenAPI Demo"
232
- }}
233
- surfaces={surfaces}
234
- // BannerContent={MemoizedActionDropdownExample}
235
- >
236
- <AtlasContext
237
- value={{
238
- syntaxHighlight: effectiveActionData.settings?.theme?.coder?.syntaxHighlight || null,
239
- baseMatch: "/docs/api",
240
- variantToggles: atlasVariantToggles,
241
- Link: FwLink,
245
+ return <Analytics settings={effectiveActionData.settings || {}} loader={() => { }}>
246
+ <UXNode
247
+ name="Framework"
248
+ props={{
249
+ location: "",
242
250
  }}
243
251
  >
244
- <MemoizedActionDropdownExample />
245
- <BaseThemeLayout>
246
- <UrlContext.Provider value={{ BaseThemePage }}>
247
- <Outlet />
248
- </UrlContext.Provider>
249
- </BaseThemeLayout>
250
- <Loader />
251
- </AtlasContext>
252
- </Framework>
252
+ <Framework
253
+ settings={effectiveActionData.settings || {}}
254
+ sidebarGroups={effectiveActionData.groups || []}
255
+ metadata={{
256
+ layout: "wide",
257
+ uniform: "1",
258
+ title: "OpenAPI Demo"
259
+ }}
260
+ surfaces={surfaces}
261
+ components={{
262
+ Search: () => <SearchButton onClick={() => alert("Demo! Check out https://xyd.dev")} />,
263
+ }}
264
+ // BannerContent={MemoizedActionDropdownExample}
265
+ >
266
+ <AtlasContext
267
+ value={{
268
+ syntaxHighlight: effectiveActionData.settings?.theme?.coder?.syntaxHighlight || null,
269
+ baseMatch: "/docs/api",
270
+ variantToggles: atlasVariantToggles,
271
+ Link: FwLink,
272
+ }}
273
+ >
274
+ <MemoizedActionDropdownExample />
275
+ <BaseThemeLayout>
276
+ <UrlContext.Provider value={{ BaseThemePage }}>
277
+ <Outlet />
278
+ </UrlContext.Provider>
279
+ </BaseThemeLayout>
280
+ <Loader />
281
+ </AtlasContext>
282
+ </Framework>
283
+ </UXNode>
284
+ </Analytics>
253
285
  }, (prevProps, nextProps) => {
254
286
  return JSON.stringify(prevProps.effectiveActionData) === JSON.stringify(nextProps.effectiveActionData);
255
287
  });
@@ -441,7 +473,7 @@ function SelectPredefinedUniformURL({
441
473
  // },
442
474
  livesession: {
443
475
  value: "livesession",
444
- url: "https://raw.githubusercontent.com/livesession/livesession-openapi/master/openapi.yaml",
476
+ url: `${import.meta.env.APP_URL || process?.env?.APP_URL || 'http://localhost:5173'}/livesession-openapi.yaml`,
445
477
  label: "Livesession",
446
478
  type: "openapi"
447
479
  },
@@ -575,6 +607,14 @@ function SelectTheme() {
575
607
  value: "picasso",
576
608
  label: "Picasso",
577
609
  },
610
+ {
611
+ value: "gusto",
612
+ label: "Gusto",
613
+ },
614
+ {
615
+ value: "solar",
616
+ label: "Solar",
617
+ },
578
618
  ]
579
619
  const [open, setOpen] = useState(false);
580
620
  const [selected, setSelected] = useState(null);
package/app/settings.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export const SETTINGS = Object.freeze({
2
2
  "theme": {
3
- "name": "picasso",
3
+ "name": "gusto",
4
4
  "icons": {
5
5
  "library": [
6
6
  {
@@ -27,9 +27,9 @@ export const SETTINGS = Object.freeze({
27
27
  }
28
28
  }
29
29
  },
30
+ "webeditor": {
31
+ },
30
32
  "navigation": {
31
- "header": [],
32
- "subheader": [],
33
33
  "sidebar": [
34
34
  {
35
35
  "route": "/docs/api",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xyd-js/apidocs-demo",
3
3
  "type": "module",
4
- "version": "0.0.0-build-9ed88cf-20250813152233",
4
+ "version": "0.0.0-build-6d91046-20250813172449",
5
5
  "dependencies": {
6
6
  "@netlify/vite-plugin-react-router": "^1.0.1",
7
7
  "@primer/primitives": "^10.7.0",
@@ -14,21 +14,21 @@
14
14
  "react-dom": "^19.1.0",
15
15
  "react-router": "^7.7.1",
16
16
  "styled-components": "^6.1.18",
17
- "@xyd-js/atlas": "0.0.0-build-9ed88cf-20250813152233",
18
- "@xyd-js/components": "0.0.0-build-9ed88cf-20250813152233",
19
- "@xyd-js/core": "0.0.0-build-9ed88cf-20250813152233",
20
- "@xyd-js/framework": "0.0.0-build-9ed88cf-20250813152233",
21
- "@xyd-js/gql": "0.0.0-build-9ed88cf-20250813152233",
22
- "@xyd-js/openapi": "0.0.0-build-9ed88cf-20250813152233",
23
- "@xyd-js/theme-cosmo": "0.0.0-build-9ed88cf-20250813152233",
24
- "@xyd-js/theme-opener": "0.0.0-build-9ed88cf-20250813152233",
25
- "@xyd-js/theme-picasso": "0.0.0-build-9ed88cf-20250813152233",
26
- "@xyd-js/theme-poetry": "0.0.0-build-9ed88cf-20250813152233",
27
- "@xyd-js/theme-gusto": "0.0.0-build-9ed88cf-20250813152233",
28
- "@xyd-js/theme-solar": "0.0.0-build-9ed88cf-20250813152233",
29
- "@xyd-js/themes": "0.0.0-build-9ed88cf-20250813152233",
30
- "@xyd-js/ui": "0.0.0-build-9ed88cf-20250813152233",
31
- "@xyd-js/uniform": "0.0.0-build-9ed88cf-20250813152233"
17
+ "@xyd-js/atlas": "0.0.0-build-6d91046-20250813172449",
18
+ "@xyd-js/components": "0.0.0-build-6d91046-20250813172449",
19
+ "@xyd-js/core": "0.0.0-build-6d91046-20250813172449",
20
+ "@xyd-js/framework": "0.0.0-build-6d91046-20250813172449",
21
+ "@xyd-js/gql": "0.0.0-build-6d91046-20250813172449",
22
+ "@xyd-js/openapi": "0.0.0-build-6d91046-20250813172449",
23
+ "@xyd-js/theme-cosmo": "0.0.0-build-6d91046-20250813172449",
24
+ "@xyd-js/theme-opener": "0.0.0-build-6d91046-20250813172449",
25
+ "@xyd-js/theme-picasso": "0.0.0-build-6d91046-20250813172449",
26
+ "@xyd-js/theme-poetry": "0.0.0-build-6d91046-20250813172449",
27
+ "@xyd-js/theme-gusto": "0.0.0-build-6d91046-20250813172449",
28
+ "@xyd-js/theme-solar": "0.0.0-build-6d91046-20250813172449",
29
+ "@xyd-js/themes": "0.0.0-build-6d91046-20250813172449",
30
+ "@xyd-js/ui": "0.0.0-build-6d91046-20250813172449",
31
+ "@xyd-js/uniform": "0.0.0-build-6d91046-20250813172449"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@react-router/dev": "^7.7.1",
@@ -44,7 +44,7 @@
44
44
  "scripts": {
45
45
  "build": "react-router build",
46
46
  "dev": "react-router dev",
47
- "start": "react-router-serve ./build/server/index.js",
47
+ "start": "react-router-serve build/server/server.js",
48
48
  "typecheck": "react-router typegen && tsc"
49
49
  }
50
50
  }
@@ -0,0 +1,1029 @@
1
+ openapi: 3.1.0
2
+
3
+ info:
4
+ title: LiveSession API
5
+ version: v1
6
+
7
+ servers:
8
+ - url: https://api.livesession.io/v1
9
+ description: Production server (uses live data)
10
+
11
+ paths:
12
+ # BEGIN Sessions
13
+ /sessions:
14
+ x-fern-sdk-group-name: sessions
15
+ x-fern-sdk-method-name: list
16
+ get:
17
+ summary: Get Sessions
18
+ security:
19
+ - livesession_oauth: [ users.sessions:read ]
20
+ - api_token: [ users.sessions:read ]
21
+ description: |
22
+ List of all sessions
23
+ tags:
24
+ - Sessions
25
+ parameters:
26
+ - name: page
27
+ in: query
28
+ description: The number of page to start with (default 0, max 10000).
29
+ schema:
30
+ type: integer
31
+ - name: size
32
+ in: query
33
+ description: The number of page's size (default 25, max 100).
34
+ schema:
35
+ type: integer
36
+ - name: email
37
+ in: query
38
+ description: The email address that you have associated with a session via [identify](/docs/api/browser/methods#identify).
39
+ schema:
40
+ type: string
41
+ - name: visitor_id
42
+ in: query
43
+ description: The visitor ID.
44
+ schema:
45
+ type: string
46
+ - name: tz
47
+ in: query
48
+ description: IANA timezone. Default Europe/London if RelativeDateString is applied.
49
+ schema:
50
+ type: string
51
+ - name: date_from
52
+ in: query
53
+ description: |
54
+ [ISO 8601](https://wikipedia.org/wiki/ISO_8601) string or [RelativeDateString](/docs/api/rest/RelativeDateString).
55
+ schema:
56
+ oneOf:
57
+ - type: string
58
+ - $ref: '#/components/schemas/RelativeDateString'
59
+ - name: date_to
60
+ in: query
61
+ description: |
62
+ [ISO 8601](https://wikipedia.org/wiki/ISO_8601) string or [RelativeDateString](/docs/api/rest/RelativeDateString).
63
+ schema:
64
+ oneOf:
65
+ - type: string
66
+ - $ref: '#/components/schemas/RelativeDateString'
67
+ responses:
68
+ '200':
69
+ description: Successful response
70
+ content:
71
+ application/json:
72
+ schema:
73
+ $ref: '#/components/schemas/GetListSessionsResponse'
74
+ '400':
75
+ description: 400 response
76
+ content:
77
+ application/json:
78
+ schema:
79
+ $ref: '#/components/schemas/ErrorResponse'
80
+ '500':
81
+ description: 500 response
82
+ content:
83
+ application/json:
84
+ schema:
85
+ $ref: '#/components/schemas/ErrorResponse'
86
+
87
+
88
+ # BEGIN Alerts
89
+ /alerts:
90
+ get:
91
+ x-fern-sdk-group-name: alerts
92
+ x-fern-sdk-method-name: list
93
+ summary: Get all alerts
94
+ security:
95
+ - livesession_oauth: [ alerts:read ]
96
+ description: |
97
+ List of all alerts
98
+ tags:
99
+ - Alerts
100
+ responses:
101
+ '200':
102
+ description: OK
103
+ content:
104
+ application/json:
105
+ schema:
106
+ type: array
107
+ items:
108
+ $ref: '#/components/schemas/Alert'
109
+ '400':
110
+ description: 400 response
111
+ content:
112
+ application/json:
113
+ schema:
114
+ $ref: '#/components/schemas/ErrorResponse'
115
+ '500':
116
+ description: 500 response
117
+ content:
118
+ application/json:
119
+ schema:
120
+ $ref: '#/components/schemas/ErrorResponse'
121
+ post:
122
+ x-fern-sdk-group-name: alerts
123
+ x-fern-sdk-method-name: create
124
+ summary: Create an alert
125
+ security:
126
+ - livesession_oauth: [ alerts:write ]
127
+ description: |
128
+ Create alert
129
+ tags:
130
+ - Alerts
131
+ requestBody:
132
+ required: true
133
+ content:
134
+ application/json:
135
+ schema:
136
+ $ref: '#/components/schemas/AlertCreate'
137
+ responses:
138
+ '201':
139
+ description: Created
140
+ content:
141
+ application/json:
142
+ schema:
143
+ $ref: '#/components/schemas/Alert'
144
+ '400':
145
+ description: 400 response
146
+ content:
147
+ application/json:
148
+ schema:
149
+ $ref: '#/components/schemas/ErrorResponse'
150
+ '500':
151
+ description: 500 response
152
+ content:
153
+ application/json:
154
+ schema:
155
+ $ref: '#/components/schemas/ErrorResponse'
156
+
157
+ /alerts/{id}:
158
+ put:
159
+ x-fern-sdk-group-name: alerts
160
+ x-fern-sdk-method-name: update
161
+ summary: Update an alert by ID
162
+ security:
163
+ - livesession_oauth: [ alerts:write ]
164
+ description: |
165
+ Update alert by ID
166
+ tags:
167
+ - Alerts
168
+ parameters:
169
+ - in: path
170
+ name: id
171
+ required: true
172
+ description: Unique identifier of the alert to update
173
+ schema:
174
+ type: string
175
+ requestBody:
176
+ required: true
177
+ content:
178
+ application/json:
179
+ schema:
180
+ $ref: '#/components/schemas/AlertUpdate'
181
+ responses:
182
+ '200':
183
+ description: OK
184
+ content:
185
+ application/json:
186
+ schema:
187
+ $ref: '#/components/schemas/Alert'
188
+ '400':
189
+ description: 400 response
190
+ content:
191
+ application/json:
192
+ schema:
193
+ $ref: '#/components/schemas/ErrorResponse'
194
+ '500':
195
+ description: 500 response
196
+ content:
197
+ application/json:
198
+ schema:
199
+ $ref: '#/components/schemas/ErrorResponse'
200
+ delete:
201
+ x-fern-sdk-group-name: alerts
202
+ x-fern-sdk-method-name: delete
203
+ summary: Delete an alert by ID
204
+ security:
205
+ - livesession_oauth: [ alerts:write ]
206
+ description: |
207
+ Delete alert by ID
208
+ tags:
209
+ - Alerts
210
+ parameters:
211
+ - in: path
212
+ name: id
213
+ required: true
214
+ description: Unique identifier of the alert to delete
215
+ schema:
216
+ type: string
217
+ responses:
218
+ '200':
219
+ description: Alert deleted
220
+ content:
221
+ application/json:
222
+ schema:
223
+ type: object
224
+ properties:
225
+ alert_id:
226
+ type: string
227
+ description: ID of the alert that was deleted
228
+ deleted:
229
+ type: boolean
230
+ description: Indicates whether the alert was successfully deleted
231
+ '400':
232
+ description: 400 response
233
+ content:
234
+ application/json:
235
+ schema:
236
+ $ref: '#/components/schemas/ErrorResponse'
237
+ '500':
238
+ description: 500 response
239
+ content:
240
+ application/json:
241
+ schema:
242
+ $ref: '#/components/schemas/ErrorResponse'
243
+
244
+ # END Alerts
245
+
246
+ # BEGIN Webhooks
247
+ /webhooks:
248
+ get:
249
+ x-fern-sdk-group-name: webhooks
250
+ x-fern-sdk-method-name: list
251
+ summary: Get a list of webhooks
252
+ security:
253
+ - livesession_oauth: [ webhooks:read ]
254
+ description: |
255
+ List of all webhooks
256
+ tags:
257
+ - Webhooks
258
+ responses:
259
+ '200':
260
+ description: List of webhooks
261
+ content:
262
+ application/json:
263
+ schema:
264
+ type: array
265
+ items:
266
+ $ref: '#/components/schemas/Webhook'
267
+ '400':
268
+ description: 400 response
269
+ content:
270
+ application/json:
271
+ schema:
272
+ $ref: '#/components/schemas/ErrorResponse'
273
+ '500':
274
+ description: 500 response
275
+ content:
276
+ application/json:
277
+ schema:
278
+ $ref: '#/components/schemas/ErrorResponse'
279
+ post:
280
+ x-fern-sdk-group-name: webhooks
281
+ x-fern-sdk-method-name: create
282
+ summary: Create a webhook
283
+ security:
284
+ - livesession_oauth: [ webhooks:write ]
285
+ description: |
286
+ Create a webhook
287
+ tags:
288
+ - Webhooks
289
+ requestBody:
290
+ description: Webhook creation request
291
+ required: true
292
+ content:
293
+ application/json:
294
+ schema:
295
+ $ref: '#/components/schemas/WebhookCreate'
296
+ responses:
297
+ '200':
298
+ description: Webhook created successfully
299
+ content:
300
+ application/json:
301
+ schema:
302
+ $ref: '#/components/schemas/Webhook'
303
+ '400':
304
+ description: 400 response
305
+ content:
306
+ application/json:
307
+ schema:
308
+ $ref: '#/components/schemas/ErrorResponse'
309
+ '500':
310
+ description: 500 response
311
+ content:
312
+ application/json:
313
+ schema:
314
+ $ref: '#/components/schemas/ErrorResponse'
315
+
316
+ /webhooks/{id}:
317
+ put:
318
+ x-fern-sdk-group-name: webhooks
319
+ x-fern-sdk-method-name: update
320
+ summary: Update a webhook
321
+ security:
322
+ - livesession_oauth: [ webhooks:write ]
323
+ description: |
324
+ Update a webhook
325
+ tags:
326
+ - Webhooks
327
+ parameters:
328
+ - name: id
329
+ in: path
330
+ description: ID of the webhook to update
331
+ required: true
332
+ schema:
333
+ type: string
334
+ - name: version
335
+ in: query
336
+ description: API version
337
+ required: true
338
+ schema:
339
+ type: string
340
+ enum: [ v1.0 ]
341
+ requestBody:
342
+ description: Webhook update request
343
+ required: true
344
+ content:
345
+ application/json:
346
+ schema:
347
+ $ref: '#/components/schemas/WebhookUpdate'
348
+ responses:
349
+ '200':
350
+ description: Webhook updated successfully
351
+ content:
352
+ application/json:
353
+ schema:
354
+ $ref: '#/components/schemas/Webhook'
355
+ '400':
356
+ description: 400 response
357
+ content:
358
+ application/json:
359
+ schema:
360
+ $ref: '#/components/schemas/ErrorResponse'
361
+ '404':
362
+ description: 404 response
363
+ '500':
364
+ description: 500 response
365
+ content:
366
+ application/json:
367
+ schema:
368
+ $ref: '#/components/schemas/ErrorResponse'
369
+
370
+ delete:
371
+ x-fern-sdk-group-name: webhooks
372
+ x-fern-sdk-method-name: delete
373
+ summary: Delete a webhook
374
+ security:
375
+ - livesession_oauth: [ webhooks:write ]
376
+ description: |
377
+ Delete a webhook
378
+ tags:
379
+ - Webhooks
380
+ parameters:
381
+ - name: id
382
+ in: path
383
+ description: ID of the webhook to delete
384
+ required: true
385
+ schema:
386
+ type: string
387
+ responses:
388
+ '200':
389
+ description: Webhook deleted successfully
390
+ content:
391
+ application/json:
392
+ schema:
393
+ $ref: '#/components/schemas/WebhookDeleted'
394
+ '400':
395
+ description: 400 response
396
+ content:
397
+ application/json:
398
+ schema:
399
+ $ref: '#/components/schemas/ErrorResponse'
400
+ '404':
401
+ description: 404 response
402
+ '500':
403
+ description: 500 response
404
+ content:
405
+ application/json:
406
+ schema:
407
+ $ref: '#/components/schemas/ErrorResponse'
408
+ # END Webhooks
409
+
410
+ # BEGIN Websites
411
+ /websites:
412
+ get:
413
+ x-fern-sdk-group-name: websites
414
+ x-fern-sdk-method-name: list
415
+ summary: Get a list of websites
416
+ security:
417
+ - livesession_oauth: [ websites:read ]
418
+ description: |
419
+ List of all websites
420
+ tags:
421
+ - Websites
422
+ responses:
423
+ '200':
424
+ description: List of websites
425
+ content:
426
+ application/json:
427
+ schema:
428
+ type: array
429
+ items:
430
+ $ref: '#/components/schemas/Website'
431
+ '400':
432
+ description: 400 response
433
+ content:
434
+ application/json:
435
+ schema:
436
+ $ref: '#/components/schemas/ErrorResponse'
437
+ '500':
438
+ description: 500 response
439
+ content:
440
+ application/json:
441
+ schema:
442
+ $ref: '#/components/schemas/ErrorResponse'
443
+ post:
444
+ x-fern-sdk-group-name: websites
445
+ x-fern-sdk-method-name: create
446
+ summary: Create a website
447
+ security:
448
+ - livesession_oauth: [ websites:write ]
449
+ description: |
450
+ Create a website
451
+ tags:
452
+ - Websites
453
+ requestBody:
454
+ description: Website creation request
455
+ required: true
456
+ content:
457
+ application/json:
458
+ schema:
459
+ $ref: '#/components/schemas/WebsiteCreate'
460
+ responses:
461
+ '200':
462
+ description: Create a website
463
+ content:
464
+ application/json:
465
+ schema:
466
+ type: object
467
+ $ref: '#/components/schemas/Website'
468
+ '400':
469
+ description: 400 response
470
+ content:
471
+ application/json:
472
+ schema:
473
+ $ref: '#/components/schemas/ErrorResponse'
474
+ '500':
475
+ description: 500 response
476
+ content:
477
+ application/json:
478
+ schema:
479
+ $ref: '#/components/schemas/ErrorResponse'
480
+ # END Websites
481
+
482
+ components:
483
+ securitySchemes:
484
+ api_token:
485
+ type: apiKey
486
+ name: Authorization
487
+ description: "[API Tokens](https://developers.livesession.io/rest-api/introduction/#creating-a-personal-access-token)"
488
+ in: header
489
+
490
+ livesession_oauth:
491
+ type: oauth2
492
+ flows:
493
+ authorizationCode:
494
+ authorizationUrl: https://apis.livesession.io/accounts/v1/oauth2/authorize
495
+ tokenUrl: https://apis.livesession.io/accounts/v1/oauth2/access_token
496
+ refreshUrl: https://apis.livesession.io/accounts/v1/oauth2/access_token
497
+ scopes:
498
+ users.sessions:read: read user sessions
499
+
500
+ webhooks:read: read webhooks
501
+ webhooks:write: write webhooks
502
+
503
+ alerts:read: read alerts
504
+ alerts:write: write alerts
505
+
506
+ websites:read: read websites
507
+ websites:write: write websites
508
+
509
+ payment_intents:write: write payment intents
510
+ payment_intents.confirm: confirm payment intents
511
+
512
+ schemas:
513
+
514
+ # BEGIN Errors
515
+ ErrorResponse:
516
+ type: object
517
+ properties:
518
+ error:
519
+ type: object
520
+ properties:
521
+ type:
522
+ type: string
523
+ description: Type of error (e.g., validation_error, authentication_error)
524
+ code:
525
+ type: string
526
+ description: Machine-readable error code
527
+ param:
528
+ type: string
529
+ description: Name of the parameter that caused the error
530
+ message:
531
+ type: string
532
+ description: Human-readable error message
533
+ http_status_code:
534
+ type: integer
535
+ description: HTTP status code associated with the error
536
+ request_id:
537
+ type: string
538
+ description: Unique identifier for the request that caused the error
539
+
540
+ # END Errors
541
+
542
+ # BEGIN Sessions
543
+ Session:
544
+ type: object
545
+ properties:
546
+ id:
547
+ type: string
548
+ description: Unique identifier for the session
549
+ website_id:
550
+ type: string
551
+ description: ID of the website where the session was recorded
552
+ session_url:
553
+ type: string
554
+ description: URL to view the session in LiveSession dashboard
555
+ creation_timestamp:
556
+ type: integer
557
+ description: Unix timestamp when the session was created
558
+ duration:
559
+ type: integer
560
+ description: Total duration of the session in seconds
561
+ end_timestamp:
562
+ type: integer
563
+ description: Unix timestamp when the session ended
564
+ active_time:
565
+ type: integer
566
+ description: Total time the user was actively interacting with the page in seconds
567
+ end_url:
568
+ type: string
569
+ description: The last URL visited during the session
570
+ expiration_timestamp:
571
+ type: integer
572
+ description: Unix timestamp when the session recording will expire
573
+ last_event_timestamp:
574
+ type: integer
575
+ description: Unix timestamp of the last event recorded in the session
576
+ product:
577
+ type: string
578
+ description: Product identifier associated with the session
579
+ device:
580
+ type: string
581
+ description: Device type (e.g., desktop, mobile, tablet)
582
+ tags:
583
+ type: array
584
+ description: Custom tags associated with the session
585
+ items:
586
+ type: string
587
+ last_seen_page_view_id:
588
+ type: string
589
+ description: ID of the last page view in the session
590
+ seen:
591
+ type: boolean
592
+ description: Whether the session has been viewed in the dashboard
593
+ referrer:
594
+ type: string
595
+ description: URL where the user came from before starting the session
596
+ start_url:
597
+ type: string
598
+ description: First URL visited during the session
599
+ visitor_first_session:
600
+ type: boolean
601
+ description: Whether this is the visitor's first session
602
+ engagment_score:
603
+ type: number
604
+ description: Calculated engagement score for the session (0-100)
605
+ visitor:
606
+ $ref: '#/components/schemas/SessionVisitorData'
607
+ resolution:
608
+ $ref: '#/components/schemas/SessionResolutionData'
609
+ os:
610
+ $ref: '#/components/schemas/SessionOsData'
611
+ browser:
612
+ $ref: '#/components/schemas/SessionBrowserData'
613
+ utm:
614
+ $ref: '#/components/schemas/SessionUTMData'
615
+ page_views_statistics:
616
+ $ref: '#/components/schemas/SessionPageViewsStatisticsData'
617
+ events_statistics:
618
+ $ref: '#/components/schemas/SessionEventsStatisticsData'
619
+
620
+ SessionVisitorData:
621
+ type: object
622
+ properties:
623
+ id:
624
+ type: string
625
+ description: Unique identifier for the visitor
626
+ ip:
627
+ type: string
628
+ description: IP address of the visitor
629
+ geolocation:
630
+ $ref: '#/components/schemas/SessionVisitorDataGeolocation'
631
+ name:
632
+ type: string
633
+ description: Name of the visitor if identified
634
+ email:
635
+ type: string
636
+ description: Email address of the visitor if identified
637
+ email_hash:
638
+ type: string
639
+ description: Hashed version of the visitor's email for privacy
640
+ params:
641
+ type: array
642
+ description: Custom parameters associated with the visitor
643
+ items:
644
+ $ref: '#/components/schemas/SessionVisitorDataParams'
645
+ last_session_timestamp:
646
+ type: integer
647
+ description: Unix timestamp of the visitor's last session
648
+ first_session_timestamp:
649
+ type: integer
650
+ description: Unix timestamp of the visitor's first session
651
+
652
+ SessionOsData:
653
+ type: object
654
+ properties:
655
+ name:
656
+ type: string
657
+ description: Operating system name (e.g., Windows, macOS, iOS)
658
+ version:
659
+ type: string
660
+ description: Operating system version
661
+
662
+ SessionBrowserData:
663
+ type: object
664
+ properties:
665
+ description:
666
+ type: string
667
+ description: Full browser description string
668
+ name:
669
+ type: string
670
+ description: Browser name (e.g., Chrome, Firefox, Safari)
671
+ version:
672
+ type: string
673
+ description: Browser version
674
+
675
+ SessionUTMData:
676
+ type: object
677
+ properties:
678
+ source:
679
+ type: string
680
+ description: UTM source parameter (e.g., google, facebook)
681
+ medium:
682
+ type: string
683
+ description: UTM medium parameter (e.g., cpc, social)
684
+ campaign:
685
+ type: string
686
+ description: UTM campaign parameter
687
+ term:
688
+ type: string
689
+ description: UTM term parameter (search keywords)
690
+ content:
691
+ type: string
692
+ description: UTM content parameter
693
+
694
+ SessionEventsStatisticsData:
695
+ type: object
696
+ properties:
697
+ clicks:
698
+ type: integer
699
+ description: Total number of clicks during the session
700
+ error_clicks:
701
+ type: integer
702
+ description: Number of clicks on error elements
703
+ rage_clicks:
704
+ type: integer
705
+ description: Number of rapid clicks indicating user frustration
706
+ error_logs:
707
+ type: integer
708
+ description: Number of JavaScript errors logged
709
+ net_errors:
710
+ type: integer
711
+ description: Number of network errors encountered
712
+
713
+ SessionPageViewLocationData:
714
+ type: object
715
+ properties:
716
+ base:
717
+ type: string
718
+ description: Base URL of the page
719
+ href:
720
+ type: string
721
+ description: Full URL of the page
722
+ origin:
723
+ type: string
724
+ description: Origin of the page (protocol + hostname)
725
+ referrer:
726
+ type: string
727
+ description: URL of the previous page
728
+
729
+ SessionPageViewViewPortData:
730
+ type: object
731
+ properties:
732
+ height:
733
+ type: integer
734
+ description: Viewport height in pixels
735
+ width:
736
+ type: integer
737
+ description: Viewport width in pixels
738
+
739
+ SessionVisitorDataGeolocation:
740
+ type: object
741
+ properties:
742
+ country_code:
743
+ type: string
744
+ description: Two-letter country code (ISO 3166-1 alpha-2)
745
+ city:
746
+ type: string
747
+ description: City name
748
+ region:
749
+ type: string
750
+ description: Region or state name
751
+
752
+ SessionVisitorDataParams:
753
+ type: object
754
+ properties:
755
+ name:
756
+ type: string
757
+ description: Parameter name
758
+ value:
759
+ type: string
760
+ description: Parameter value
761
+
762
+ SessionResolutionData:
763
+ type: object
764
+ properties:
765
+ height:
766
+ type: integer
767
+ description: Screen height in pixels
768
+ width:
769
+ type: integer
770
+ description: Screen width in pixels
771
+ resolution:
772
+ type: string
773
+ description: Screen resolution (e.g., "1920x1080")
774
+
775
+ SessionPageViewsStatisticsData:
776
+ type: object
777
+ properties:
778
+ count:
779
+ type: integer
780
+ description: Total number of page views in the session
781
+
782
+ GetListSessionsResponse:
783
+ type: object
784
+ properties:
785
+ total:
786
+ type: integer
787
+ description: Total number of sessions matching the query
788
+ page:
789
+ $ref: '#/components/schemas/Pagination'
790
+ sessions:
791
+ type: array
792
+ description: List of session objects
793
+ items:
794
+ $ref: '#/components/schemas/Session'
795
+
796
+ Pagination:
797
+ type: object
798
+ properties:
799
+ num:
800
+ type: integer
801
+ description: Current page number
802
+ size:
803
+ type: integer
804
+ description: Number of items per page
805
+
806
+ RelativeDateString:
807
+ type: string
808
+ description: |
809
+ * `TODAY` - Today since midnight
810
+ * `YESTERDAY` - Yesterday since midnight
811
+ * `BEGINNING_OF_WEEK` - Nearest monday since midnight
812
+ * `BEGINNING_OF_MONTH` - 1st of the month since midnight
813
+ * `BEGINNING_OF_PREV_MONTH` - Previous 1st of the month since midnight
814
+ * `TODAY-7DAYS` - Exact 7 days ago since midnight
815
+ * `TODAY-30DAYS` - Exact 30 days ago since midnight
816
+ enum:
817
+ - TODAY
818
+ - YESTERDAY
819
+ - BEGINNING_OF_WEEK
820
+ - BEGINNING_OF_MONTH
821
+ - BEGINNING_OF_PREV_MONTH
822
+ - TODAY-7DAYS
823
+ - TODAY-30DAYS
824
+ # END Sessions
825
+
826
+ # BEGIN Alerts
827
+ AlertCreate:
828
+ type: object
829
+ required:
830
+ - name
831
+ - events
832
+ - provider
833
+ properties:
834
+ name:
835
+ type: string
836
+ description: Name of the alert for easy identification
837
+ events:
838
+ type: array
839
+ description: List of events that will trigger the alert
840
+ items:
841
+ $ref: '#/components/schemas/AlertEvent'
842
+ provider:
843
+ $ref: '#/components/schemas/AlertProviderEnum'
844
+ description: Notification provider for the alert, `slack` or `webhooks`
845
+ slack_channel_id:
846
+ type: string
847
+ description: Slack channel ID where notifications will be sent (required if provider is `slack`)
848
+ webhook_id:
849
+ type: string
850
+ description: Webhook ID where notifications will be sent (required if provider is `webhooks`)
851
+
852
+ AlertUpdate:
853
+ type: object
854
+ properties:
855
+ name:
856
+ type: string
857
+ description: New name for the alert
858
+ events:
859
+ type: array
860
+ description: Updated list of events that will trigger the alert
861
+ items:
862
+ $ref: '#/components/schemas/AlertEvent'
863
+ provider:
864
+ $ref: '#/components/schemas/AlertProviderEnum'
865
+ description: Updated notification provider for the alert
866
+ slack_channel_id:
867
+ type: string
868
+ description: Updated Slack channel ID for notifications
869
+ webhook_id:
870
+ type: string
871
+ description: Updated webhook ID for notifications
872
+
873
+ AlertEvent:
874
+ type: object
875
+ properties:
876
+ kind:
877
+ type: integer
878
+ description: Kind of event, more info [here](/docs/api/rest/EventKind)
879
+ value:
880
+ type: string
881
+ description: Value or threshold that triggers the alert
882
+
883
+ Alert:
884
+ type: object
885
+ properties:
886
+ alert_id:
887
+ type: string
888
+ description: Unique identifier for the alert
889
+ name:
890
+ type: string
891
+ description: Name of the alert
892
+ events:
893
+ type: array
894
+ description: List of events that trigger the alert
895
+ items:
896
+ $ref: '#/components/schemas/AlertEvent'
897
+ provider:
898
+ $ref: '#/components/schemas/AlertProviderEnum'
899
+ description: Notification provider for the alert
900
+ slack_channel_id:
901
+ type: string
902
+ description: Slack channel ID for notifications
903
+ webhook_id:
904
+ type: string
905
+ description: Webhook ID for notifications
906
+ enabled:
907
+ type: boolean
908
+ description: Whether the alert is currently active
909
+ creation_date:
910
+ type: string
911
+ description: |
912
+ [ISO 8601](https://wikipedia.org/wiki/ISO_8601) timestamp when the alert was created
913
+
914
+ AlertDeleted:
915
+ type: object
916
+ properties:
917
+ alert_id:
918
+ type: string
919
+ description: ID of the deleted alert
920
+ deleted:
921
+ type: boolean
922
+ description: Confirmation that the alert was deleted
923
+
924
+ AlertProviderEnum:
925
+ type: string
926
+ description: Available notification providers for alerts
927
+ enum:
928
+ - slack
929
+ - webhooks
930
+ # END Alerts
931
+
932
+ # BEGIN Webhooks
933
+ WebhookCreate:
934
+ type: object
935
+ required:
936
+ - url
937
+ - website_id
938
+ - version
939
+ properties:
940
+ url:
941
+ type: string
942
+ description: URL for the webhook
943
+ website_id:
944
+ type: string
945
+ description: Website ID
946
+ version:
947
+ type: string
948
+ description: API version (e.g., v1.0)
949
+ WebhookUpdate:
950
+ type: object
951
+ required:
952
+ - url
953
+ - website_id
954
+ - version
955
+ properties:
956
+ url:
957
+ type: string
958
+ description: URL for the webhook
959
+ website_id:
960
+ type: string
961
+ description: Website ID
962
+ version:
963
+ type: string
964
+ description: API version (e.g., v1.0)
965
+ Webhook:
966
+ type: object
967
+ properties:
968
+ webhook_id:
969
+ type: string
970
+ description: Webhook ID
971
+ url:
972
+ type: string
973
+ description: URL for the webhook
974
+ website:
975
+ type: string
976
+ description: Website name
977
+ website_id:
978
+ type: string
979
+ description: Website ID
980
+ version:
981
+ type: string
982
+ description: API version
983
+ enabled:
984
+ type: boolean
985
+ description: Webhook enabled status
986
+ created_date:
987
+ type: integer
988
+ format: int64
989
+ description: Unix timestamp for creation date
990
+ created_by:
991
+ type: string
992
+ description: Creator of the webhook
993
+ WebhookDeleted:
994
+ type: object
995
+ properties:
996
+ webhook_id:
997
+ type: string
998
+ description: Webhook ID
999
+ deleted:
1000
+ type: boolean
1001
+ description: Indicates if the webhook was deleted
1002
+ # END Webhooks
1003
+
1004
+ # BEGIN Websites
1005
+ Website:
1006
+ type: object
1007
+ properties:
1008
+ website_id:
1009
+ type: string
1010
+ description: Unique identifier for the website
1011
+ host:
1012
+ type: string
1013
+ description: Domain name or hostname of the website (e.g., example.com)
1014
+
1015
+ WebsiteCreate:
1016
+ type: object
1017
+ required:
1018
+ - host
1019
+ properties:
1020
+ host:
1021
+ type: string
1022
+ description: Domain name or hostname of the website to track
1023
+ description:
1024
+ type: string
1025
+ description: Optional description of the website for organization purposes
1026
+ # END Websites
1027
+
1028
+
1029
+