zorihq 0.4.1 → 0.6.0
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 +16 -0
- package/package.json +2 -2
- package/resources/v1/analytics/analytics.d.mts +108 -1
- package/resources/v1/analytics/analytics.d.mts.map +1 -1
- package/resources/v1/analytics/analytics.d.ts +108 -1
- package/resources/v1/analytics/analytics.d.ts.map +1 -1
- package/resources/v1/analytics/analytics.js +28 -0
- package/resources/v1/analytics/analytics.js.map +1 -1
- package/resources/v1/analytics/analytics.mjs +28 -0
- package/resources/v1/analytics/analytics.mjs.map +1 -1
- package/resources/v1/analytics/index.d.mts +4 -1
- package/resources/v1/analytics/index.d.mts.map +1 -1
- package/resources/v1/analytics/index.d.ts +4 -1
- package/resources/v1/analytics/index.d.ts.map +1 -1
- package/resources/v1/analytics/index.js +7 -1
- package/resources/v1/analytics/index.js.map +1 -1
- package/resources/v1/analytics/index.mjs +3 -0
- package/resources/v1/analytics/index.mjs.map +1 -1
- package/resources/v1/analytics/retention.d.mts +83 -0
- package/resources/v1/analytics/retention.d.mts.map +1 -0
- package/resources/v1/analytics/retention.d.ts +83 -0
- package/resources/v1/analytics/retention.d.ts.map +1 -0
- package/resources/v1/analytics/retention.js +54 -0
- package/resources/v1/analytics/retention.js.map +1 -0
- package/resources/v1/analytics/retention.mjs +50 -0
- package/resources/v1/analytics/retention.mjs.map +1 -0
- package/resources/v1/analytics/sessions.d.mts +60 -0
- package/resources/v1/analytics/sessions.d.mts.map +1 -0
- package/resources/v1/analytics/sessions.d.ts +60 -0
- package/resources/v1/analytics/sessions.d.ts.map +1 -0
- package/resources/v1/analytics/sessions.js +39 -0
- package/resources/v1/analytics/sessions.js.map +1 -0
- package/resources/v1/analytics/sessions.mjs +35 -0
- package/resources/v1/analytics/sessions.mjs.map +1 -0
- package/resources/v1/analytics/users.d.mts +28 -0
- package/resources/v1/analytics/users.d.mts.map +1 -0
- package/resources/v1/analytics/users.d.ts +28 -0
- package/resources/v1/analytics/users.d.ts.map +1 -0
- package/resources/v1/analytics/users.js +23 -0
- package/resources/v1/analytics/users.js.map +1 -0
- package/resources/v1/analytics/users.mjs +19 -0
- package/resources/v1/analytics/users.mjs.map +1 -0
- package/resources/v1/index.d.mts +2 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/payment-providers.d.mts +109 -0
- package/resources/v1/payment-providers.d.mts.map +1 -0
- package/resources/v1/payment-providers.d.ts +109 -0
- package/resources/v1/payment-providers.d.ts.map +1 -0
- package/resources/v1/payment-providers.js +75 -0
- package/resources/v1/payment-providers.js.map +1 -0
- package/resources/v1/payment-providers.mjs +71 -0
- package/resources/v1/payment-providers.mjs.map +1 -0
- package/resources/v1/v1.d.mts +6 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +6 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/analytics/analytics.ts +181 -0
- package/src/resources/v1/analytics/index.ts +18 -0
- package/src/resources/v1/analytics/retention.ts +114 -0
- package/src/resources/v1/analytics/sessions.ts +82 -0
- package/src/resources/v1/analytics/users.ts +34 -0
- package/src/resources/v1/index.ts +21 -0
- package/src/resources/v1/payment-providers.ts +167 -0
- package/src/resources/v1/v1.ts +48 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import * as EventsAPI from './events';
|
|
5
5
|
import { EventRecentParams, Events } from './events';
|
|
6
|
+
import * as RetentionAPI from './retention';
|
|
7
|
+
import {
|
|
8
|
+
Retention,
|
|
9
|
+
RetentionChurnRateParams,
|
|
10
|
+
RetentionCohortsParams,
|
|
11
|
+
RetentionReturnRateParams,
|
|
12
|
+
} from './retention';
|
|
13
|
+
import * as SessionsAPI from './sessions';
|
|
14
|
+
import { SessionBounceRateParams, SessionMetricsParams, Sessions } from './sessions';
|
|
15
|
+
import * as UsersAPI from './users';
|
|
16
|
+
import { UserActiveParams, Users } from './users';
|
|
6
17
|
import * as VisitorsAPI from './visitors';
|
|
7
18
|
import {
|
|
8
19
|
VisitorByCountryParams,
|
|
@@ -13,10 +24,86 @@ import {
|
|
|
13
24
|
VisitorTopParams,
|
|
14
25
|
Visitors,
|
|
15
26
|
} from './visitors';
|
|
27
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
28
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
16
29
|
|
|
17
30
|
export class Analytics extends APIResource {
|
|
18
31
|
visitors: VisitorsAPI.Visitors = new VisitorsAPI.Visitors(this._client);
|
|
19
32
|
events: EventsAPI.Events = new EventsAPI.Events(this._client);
|
|
33
|
+
sessions: SessionsAPI.Sessions = new SessionsAPI.Sessions(this._client);
|
|
34
|
+
users: UsersAPI.Users = new UsersAPI.Users(this._client);
|
|
35
|
+
retention: RetentionAPI.Retention = new RetentionAPI.Retention(this._client);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get combined key metrics including sessions, active users, bounce rate, and
|
|
39
|
+
* retention for dashboard display
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const dashboardMetricsResponse =
|
|
44
|
+
* await client.v1.analytics.dashboard({
|
|
45
|
+
* project_id: 'project_id',
|
|
46
|
+
* time_range: 'last_hour',
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
dashboard(query: AnalyticsDashboardParams, options?: RequestOptions): APIPromise<DashboardMetricsResponse> {
|
|
51
|
+
return this._client.get('/api/v1/analytics/dashboard', { query, ...options });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface ActiveUsersResponse {
|
|
56
|
+
dau?: number;
|
|
57
|
+
|
|
58
|
+
mau?: number;
|
|
59
|
+
|
|
60
|
+
wau?: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface BounceRateByPageMetric {
|
|
64
|
+
bounce_rate?: number;
|
|
65
|
+
|
|
66
|
+
page?: string;
|
|
67
|
+
|
|
68
|
+
sessions?: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface BounceRateResponse {
|
|
72
|
+
by_page?: Array<BounceRateByPageMetric>;
|
|
73
|
+
|
|
74
|
+
overall_bounce_rate?: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface ChurnRateResponse {
|
|
78
|
+
churn_rate_percent?: number;
|
|
79
|
+
|
|
80
|
+
churn_threshold_days?: number;
|
|
81
|
+
|
|
82
|
+
churned_users?: number;
|
|
83
|
+
|
|
84
|
+
total_users?: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface CohortAnalysisResponse {
|
|
88
|
+
cohorts?: Array<CohortData>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface CohortData {
|
|
92
|
+
cohort_period?: string;
|
|
93
|
+
|
|
94
|
+
cohort_size?: number;
|
|
95
|
+
|
|
96
|
+
month_1_retention?: number;
|
|
97
|
+
|
|
98
|
+
month_2_retention?: number;
|
|
99
|
+
|
|
100
|
+
month_3_retention?: number;
|
|
101
|
+
|
|
102
|
+
week_1_retention?: number;
|
|
103
|
+
|
|
104
|
+
week_2_retention?: number;
|
|
105
|
+
|
|
106
|
+
week_4_retention?: number;
|
|
20
107
|
}
|
|
21
108
|
|
|
22
109
|
export interface CountryDataPoint {
|
|
@@ -27,6 +114,42 @@ export interface CountryDataPoint {
|
|
|
27
114
|
unique_visitors?: number;
|
|
28
115
|
}
|
|
29
116
|
|
|
117
|
+
export interface DashboardMetricsResponse {
|
|
118
|
+
avg_pages_per_session?: number;
|
|
119
|
+
|
|
120
|
+
avg_session_duration_seconds?: number;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Engagement metrics
|
|
124
|
+
*/
|
|
125
|
+
bounce_rate?: number;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Active users
|
|
129
|
+
*/
|
|
130
|
+
dau?: number;
|
|
131
|
+
|
|
132
|
+
mau?: number;
|
|
133
|
+
|
|
134
|
+
return_rate?: number;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Sessions
|
|
138
|
+
*/
|
|
139
|
+
sessions_today?: number;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Total metrics
|
|
143
|
+
*/
|
|
144
|
+
total_events?: number;
|
|
145
|
+
|
|
146
|
+
total_sessions_in_period?: number;
|
|
147
|
+
|
|
148
|
+
unique_visitors?: number;
|
|
149
|
+
|
|
150
|
+
wau?: number;
|
|
151
|
+
}
|
|
152
|
+
|
|
30
153
|
export interface EventsOverTimeDataPoint {
|
|
31
154
|
event_count?: number;
|
|
32
155
|
|
|
@@ -69,6 +192,24 @@ export interface RecentEventsResponse {
|
|
|
69
192
|
total?: number;
|
|
70
193
|
}
|
|
71
194
|
|
|
195
|
+
export interface ReturnRateResponse {
|
|
196
|
+
avg_time_between_sessions_hours?: number;
|
|
197
|
+
|
|
198
|
+
return_rate_percent?: number;
|
|
199
|
+
|
|
200
|
+
returning_users?: number;
|
|
201
|
+
|
|
202
|
+
total_users?: number;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface SessionMetricsResponse {
|
|
206
|
+
average_pages_per_session?: number;
|
|
207
|
+
|
|
208
|
+
average_session_duration_seconds?: number;
|
|
209
|
+
|
|
210
|
+
total_sessions?: number;
|
|
211
|
+
}
|
|
212
|
+
|
|
72
213
|
export interface TopVisitor {
|
|
73
214
|
browser_name?: string;
|
|
74
215
|
|
|
@@ -165,16 +306,40 @@ export interface VisitorsByOriginResponse {
|
|
|
165
306
|
data?: Array<OriginDataPoint>;
|
|
166
307
|
}
|
|
167
308
|
|
|
309
|
+
export interface AnalyticsDashboardParams {
|
|
310
|
+
/**
|
|
311
|
+
* Project ID
|
|
312
|
+
*/
|
|
313
|
+
project_id: string;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Time range
|
|
317
|
+
*/
|
|
318
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
319
|
+
}
|
|
320
|
+
|
|
168
321
|
Analytics.Visitors = Visitors;
|
|
169
322
|
Analytics.Events = Events;
|
|
323
|
+
Analytics.Sessions = Sessions;
|
|
324
|
+
Analytics.Users = Users;
|
|
325
|
+
Analytics.Retention = Retention;
|
|
170
326
|
|
|
171
327
|
export declare namespace Analytics {
|
|
172
328
|
export {
|
|
329
|
+
type ActiveUsersResponse as ActiveUsersResponse,
|
|
330
|
+
type BounceRateByPageMetric as BounceRateByPageMetric,
|
|
331
|
+
type BounceRateResponse as BounceRateResponse,
|
|
332
|
+
type ChurnRateResponse as ChurnRateResponse,
|
|
333
|
+
type CohortAnalysisResponse as CohortAnalysisResponse,
|
|
334
|
+
type CohortData as CohortData,
|
|
173
335
|
type CountryDataPoint as CountryDataPoint,
|
|
336
|
+
type DashboardMetricsResponse as DashboardMetricsResponse,
|
|
174
337
|
type EventsOverTimeDataPoint as EventsOverTimeDataPoint,
|
|
175
338
|
type OriginDataPoint as OriginDataPoint,
|
|
176
339
|
type RecentEvent as RecentEvent,
|
|
177
340
|
type RecentEventsResponse as RecentEventsResponse,
|
|
341
|
+
type ReturnRateResponse as ReturnRateResponse,
|
|
342
|
+
type SessionMetricsResponse as SessionMetricsResponse,
|
|
178
343
|
type TopVisitor as TopVisitor,
|
|
179
344
|
type TopVisitorsResponse as TopVisitorsResponse,
|
|
180
345
|
type UniqueVisitorsDataPoint as UniqueVisitorsDataPoint,
|
|
@@ -185,6 +350,7 @@ export declare namespace Analytics {
|
|
|
185
350
|
type VisitorsByCountryResponse as VisitorsByCountryResponse,
|
|
186
351
|
type VisitorsByDeviceResponse as VisitorsByDeviceResponse,
|
|
187
352
|
type VisitorsByOriginResponse as VisitorsByOriginResponse,
|
|
353
|
+
type AnalyticsDashboardParams as AnalyticsDashboardParams,
|
|
188
354
|
};
|
|
189
355
|
|
|
190
356
|
export {
|
|
@@ -198,4 +364,19 @@ export declare namespace Analytics {
|
|
|
198
364
|
};
|
|
199
365
|
|
|
200
366
|
export { Events as Events, type EventRecentParams as EventRecentParams };
|
|
367
|
+
|
|
368
|
+
export {
|
|
369
|
+
Sessions as Sessions,
|
|
370
|
+
type SessionBounceRateParams as SessionBounceRateParams,
|
|
371
|
+
type SessionMetricsParams as SessionMetricsParams,
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
export { Users as Users, type UserActiveParams as UserActiveParams };
|
|
375
|
+
|
|
376
|
+
export {
|
|
377
|
+
Retention as Retention,
|
|
378
|
+
type RetentionChurnRateParams as RetentionChurnRateParams,
|
|
379
|
+
type RetentionCohortsParams as RetentionCohortsParams,
|
|
380
|
+
type RetentionReturnRateParams as RetentionReturnRateParams,
|
|
381
|
+
};
|
|
201
382
|
}
|
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
4
|
Analytics,
|
|
5
|
+
type ActiveUsersResponse,
|
|
6
|
+
type BounceRateByPageMetric,
|
|
7
|
+
type BounceRateResponse,
|
|
8
|
+
type ChurnRateResponse,
|
|
9
|
+
type CohortAnalysisResponse,
|
|
10
|
+
type CohortData,
|
|
5
11
|
type CountryDataPoint,
|
|
12
|
+
type DashboardMetricsResponse,
|
|
6
13
|
type EventsOverTimeDataPoint,
|
|
7
14
|
type OriginDataPoint,
|
|
8
15
|
type RecentEvent,
|
|
9
16
|
type RecentEventsResponse,
|
|
17
|
+
type ReturnRateResponse,
|
|
18
|
+
type SessionMetricsResponse,
|
|
10
19
|
type TopVisitor,
|
|
11
20
|
type TopVisitorsResponse,
|
|
12
21
|
type UniqueVisitorsDataPoint,
|
|
@@ -17,8 +26,17 @@ export {
|
|
|
17
26
|
type VisitorsByCountryResponse,
|
|
18
27
|
type VisitorsByDeviceResponse,
|
|
19
28
|
type VisitorsByOriginResponse,
|
|
29
|
+
type AnalyticsDashboardParams,
|
|
20
30
|
} from './analytics';
|
|
21
31
|
export { Events, type EventRecentParams } from './events';
|
|
32
|
+
export {
|
|
33
|
+
Retention,
|
|
34
|
+
type RetentionChurnRateParams,
|
|
35
|
+
type RetentionCohortsParams,
|
|
36
|
+
type RetentionReturnRateParams,
|
|
37
|
+
} from './retention';
|
|
38
|
+
export { Sessions, type SessionBounceRateParams, type SessionMetricsParams } from './sessions';
|
|
39
|
+
export { Users, type UserActiveParams } from './users';
|
|
22
40
|
export {
|
|
23
41
|
Visitors,
|
|
24
42
|
type VisitorByCountryParams,
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as AnalyticsAPI from './analytics';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Retention extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get metrics about user churn based on inactivity threshold
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const churnRateResponse =
|
|
15
|
+
* await client.v1.analytics.retention.churnRate({
|
|
16
|
+
* project_id: 'project_id',
|
|
17
|
+
* time_range: 'last_hour',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
churnRate(
|
|
22
|
+
query: RetentionChurnRateParams,
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): APIPromise<AnalyticsAPI.ChurnRateResponse> {
|
|
25
|
+
return this._client.get('/api/v1/analytics/retention/churn-rate', { query, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get cohort retention analysis showing how user groups retain over time
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const cohortAnalysisResponse =
|
|
34
|
+
* await client.v1.analytics.retention.cohorts({
|
|
35
|
+
* project_id: 'project_id',
|
|
36
|
+
* time_range: 'last_hour',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
cohorts(
|
|
41
|
+
query: RetentionCohortsParams,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): APIPromise<AnalyticsAPI.CohortAnalysisResponse> {
|
|
44
|
+
return this._client.get('/api/v1/analytics/retention/cohorts', { query, ...options });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get metrics about user return rate and time between sessions
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const returnRateResponse =
|
|
53
|
+
* await client.v1.analytics.retention.returnRate({
|
|
54
|
+
* project_id: 'project_id',
|
|
55
|
+
* time_range: 'last_hour',
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
returnRate(
|
|
60
|
+
query: RetentionReturnRateParams,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): APIPromise<AnalyticsAPI.ReturnRateResponse> {
|
|
63
|
+
return this._client.get('/api/v1/analytics/retention/return-rate', { query, ...options });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface RetentionChurnRateParams {
|
|
68
|
+
/**
|
|
69
|
+
* Project ID
|
|
70
|
+
*/
|
|
71
|
+
project_id: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Time range
|
|
75
|
+
*/
|
|
76
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Days of inactivity to consider churned (default: 30)
|
|
80
|
+
*/
|
|
81
|
+
churn_threshold_days?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface RetentionCohortsParams {
|
|
85
|
+
/**
|
|
86
|
+
* Project ID
|
|
87
|
+
*/
|
|
88
|
+
project_id: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Time range
|
|
92
|
+
*/
|
|
93
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface RetentionReturnRateParams {
|
|
97
|
+
/**
|
|
98
|
+
* Project ID
|
|
99
|
+
*/
|
|
100
|
+
project_id: string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Time range
|
|
104
|
+
*/
|
|
105
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export declare namespace Retention {
|
|
109
|
+
export {
|
|
110
|
+
type RetentionChurnRateParams as RetentionChurnRateParams,
|
|
111
|
+
type RetentionCohortsParams as RetentionCohortsParams,
|
|
112
|
+
type RetentionReturnRateParams as RetentionReturnRateParams,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as AnalyticsAPI from './analytics';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Sessions extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get bounce rate metrics including overall bounce rate and per-page breakdown
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const bounceRateResponse =
|
|
15
|
+
* await client.v1.analytics.sessions.bounceRate({
|
|
16
|
+
* project_id: 'project_id',
|
|
17
|
+
* time_range: 'last_hour',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
bounceRate(
|
|
22
|
+
query: SessionBounceRateParams,
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): APIPromise<AnalyticsAPI.BounceRateResponse> {
|
|
25
|
+
return this._client.get('/api/v1/analytics/sessions/bounce-rate', { query, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get session metrics including average duration and pages per session
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const sessionMetricsResponse =
|
|
34
|
+
* await client.v1.analytics.sessions.metrics({
|
|
35
|
+
* project_id: 'project_id',
|
|
36
|
+
* time_range: 'last_hour',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
metrics(
|
|
41
|
+
query: SessionMetricsParams,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): APIPromise<AnalyticsAPI.SessionMetricsResponse> {
|
|
44
|
+
return this._client.get('/api/v1/analytics/sessions/metrics', { query, ...options });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface SessionBounceRateParams {
|
|
49
|
+
/**
|
|
50
|
+
* Project ID
|
|
51
|
+
*/
|
|
52
|
+
project_id: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Time range
|
|
56
|
+
*/
|
|
57
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Limit for per-page breakdown (default: 20)
|
|
61
|
+
*/
|
|
62
|
+
limit?: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface SessionMetricsParams {
|
|
66
|
+
/**
|
|
67
|
+
* Project ID
|
|
68
|
+
*/
|
|
69
|
+
project_id: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Time range
|
|
73
|
+
*/
|
|
74
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export declare namespace Sessions {
|
|
78
|
+
export {
|
|
79
|
+
type SessionBounceRateParams as SessionBounceRateParams,
|
|
80
|
+
type SessionMetricsParams as SessionMetricsParams,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as AnalyticsAPI from './analytics';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Users extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get daily, weekly, and monthly active user counts
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const activeUsersResponse =
|
|
15
|
+
* await client.v1.analytics.users.active({
|
|
16
|
+
* project_id: 'project_id',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
active(query: UserActiveParams, options?: RequestOptions): APIPromise<AnalyticsAPI.ActiveUsersResponse> {
|
|
21
|
+
return this._client.get('/api/v1/analytics/users/active', { query, ...options });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface UserActiveParams {
|
|
26
|
+
/**
|
|
27
|
+
* Project ID
|
|
28
|
+
*/
|
|
29
|
+
project_id: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare namespace Users {
|
|
33
|
+
export { type UserActiveParams as UserActiveParams };
|
|
34
|
+
}
|
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
4
|
Analytics,
|
|
5
|
+
type ActiveUsersResponse,
|
|
6
|
+
type BounceRateByPageMetric,
|
|
7
|
+
type BounceRateResponse,
|
|
8
|
+
type ChurnRateResponse,
|
|
9
|
+
type CohortAnalysisResponse,
|
|
10
|
+
type CohortData,
|
|
5
11
|
type CountryDataPoint,
|
|
12
|
+
type DashboardMetricsResponse,
|
|
6
13
|
type EventsOverTimeDataPoint,
|
|
7
14
|
type OriginDataPoint,
|
|
8
15
|
type RecentEvent,
|
|
9
16
|
type RecentEventsResponse,
|
|
17
|
+
type ReturnRateResponse,
|
|
18
|
+
type SessionMetricsResponse,
|
|
10
19
|
type TopVisitor,
|
|
11
20
|
type TopVisitorsResponse,
|
|
12
21
|
type UniqueVisitorsDataPoint,
|
|
@@ -17,6 +26,7 @@ export {
|
|
|
17
26
|
type VisitorsByCountryResponse,
|
|
18
27
|
type VisitorsByDeviceResponse,
|
|
19
28
|
type VisitorsByOriginResponse,
|
|
29
|
+
type AnalyticsDashboardParams,
|
|
20
30
|
} from './analytics/index';
|
|
21
31
|
export {
|
|
22
32
|
Auth,
|
|
@@ -31,6 +41,17 @@ export {
|
|
|
31
41
|
type AuthRegisterAccountParams,
|
|
32
42
|
type AuthRequestPasswordRecoveryParams,
|
|
33
43
|
} from './auth';
|
|
44
|
+
export {
|
|
45
|
+
PaymentProviders,
|
|
46
|
+
type CreatePaymentProviderRequest,
|
|
47
|
+
type ListPaymentProvidersResponse,
|
|
48
|
+
type PaymentProviderResponse,
|
|
49
|
+
type UpdatePaymentProviderRequest,
|
|
50
|
+
type PaymentProviderDeleteResponse,
|
|
51
|
+
type PaymentProviderCreateParams,
|
|
52
|
+
type PaymentProviderUpdateParams,
|
|
53
|
+
type PaymentProviderListParams,
|
|
54
|
+
} from './payment-providers';
|
|
34
55
|
export {
|
|
35
56
|
Projects,
|
|
36
57
|
type CreateProjectRequest,
|