@pomeloanalytics/api 0.1.0-beta.1 → 0.1.0-beta.3

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,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-beta.3
4
+
5
+ - Add optional per-metric Content sample counts and the selected measurement method to generated API types.
6
+ - Preserve missing, zero and sparse observations without client-side aggregation or default values.
7
+ - Keep the HTTP client implementation, server-side token boundary and request behavior unchanged.
8
+
9
+ ## 0.1.0-beta.2
10
+
11
+ - Add the product website, documentation links and relevant npm keywords.
12
+ - Clarify server-side setup, the first `me()` call and report examples.
13
+ - Keep the API implementation and generated contract types unchanged.
14
+
3
15
  ## 0.1.0-beta.1
4
16
 
5
17
  - Sync the reviewed public contract for optional Acquisition `goalId` selection
package/README.md CHANGED
@@ -1,9 +1,17 @@
1
1
  # @pomeloanalytics/api
2
2
 
3
- Server-side TypeScript client for the Pomelo Analytics API.
3
+ Read your Pomelo Analytics data from a Node.js backend. This TypeScript client
4
+ provides typed access to sites, reports, goals and API usage.
4
5
 
5
- This package uses the `beta` prerelease line. Its exact version is recorded in
6
- [package.json](package.json). MIT licensed.
6
+ [Website](https://www.pomeloanalytics.com/) ·
7
+ [Getting started](https://docs.pomeloanalytics.com/en/getting-started/) ·
8
+ [Démarrer en français](https://docs.pomeloanalytics.com/fr/getting-started/) ·
9
+ [API reference](https://docs.pomeloanalytics.com/en/api-reference/) ·
10
+ [Source and issues](https://github.com/pomeloanalytics/pomelo-js)
11
+
12
+ This package uses the `beta` prerelease line and is licensed under MIT. Check
13
+ the version shown by npm before installing. Browser pageviews and events are
14
+ collected by Pomelo's tracking script, installed through the getting-started guide.
7
15
 
8
16
  Use Node.js 22.13+ on the Node 22 release line or Node.js 24. The package uses ESM
9
17
  and has no runtime dependencies. CommonJS consumers on these supported Node
@@ -27,7 +35,7 @@ npm view @pomeloanalytics/api dist-tags versions --json
27
35
  A source checkout or local tarball may contain an unpublished candidate.
28
36
  Registry metadata determines which versions are available from npm.
29
37
 
30
- ## Usage
38
+ ## First API call
31
39
 
32
40
  ```ts
33
41
  import { createPomeloClient } from '@pomeloanalytics/api';
@@ -37,6 +45,20 @@ const token = process.env.POMELO_API_TOKEN;
37
45
  if (!token) throw new Error('Configure POMELO_API_TOKEN on the server.');
38
46
  const pomelo = createPomeloClient({ token });
39
47
 
48
+ // Check which account and permissions the token can access.
49
+ const { data: account } = await pomelo.me();
50
+ ```
51
+
52
+ Create a read token in the Pomelo dashboard as described in the getting-started
53
+ guide. Keep it in server configuration, outside source control and browser code.
54
+ API access depends on your plan and the token's permissions. The API enforces
55
+ collection-profile availability for each endpoint.
56
+
57
+ ## Read metrics
58
+
59
+ Use a site ID returned by `pomelo.sites.list()` and explicit inclusive UTC dates:
60
+
61
+ ```ts
40
62
  const result = await pomelo.metrics.timeseries({
41
63
  siteId: 'site-test',
42
64
  from: '2026-10-01',
@@ -87,6 +109,15 @@ The server owns defaults, period validation, entitlements, and numeric limits;
87
109
  the SDK does not choose content depth, clamp limits, or change a requested range.
88
110
  The `details` alias for content `include` remains accepted by the public contract.
89
111
 
112
+ Full Content responses can include `current.metric_method` and
113
+ `current.pages[].performance.n_lcp`, `n_fcp`, `n_inp`, `n_cls` and `n_ttfb`.
114
+ These optional fields identify the selected measurement method and each metric's
115
+ own observation count. `samples` remains the combined event count; it does not
116
+ establish coverage for every metric. The client preserves missing counts, zero
117
+ counts and null values without recomputing percentiles or filling defaults.
118
+ Browser performance collection is performed by the separate tracking script.
119
+
120
+
90
121
  Acquisition has three distinct response shapes. The SDK forwards `include`
91
122
  unchanged and returns the complete response without renaming one shape into another.
92
123
 
@@ -183,20 +214,8 @@ identifier takes precedence in response metadata.
183
214
  Response bodies retain API field names, including `snake_case`, `availability`,
184
215
  and metering metadata. There is no cache, aggregation, or fallback endpoint.
185
216
 
186
- ## Local package
187
-
188
- From the repository root, verify and create an installable local tarball:
189
-
190
- ```sh
191
- npm ci
192
- npm run check
193
- mkdir -p .artifacts
194
- npm pack --workspace @pomeloanalytics/api --ignore-scripts --pack-destination .artifacts
195
- ```
196
-
197
- Install that tarball into another Node ESM project with
198
- `npm install /path/to/pomeloanalytics-api-0.1.0-beta.1.tgz`.
217
+ ## Help and contributions
199
218
 
200
- The repository includes a server example and a runnable synthetic consumer.
201
- The package audit compiles and executes the synthetic consumer in a fresh
202
- temporary project using the local tarball. It makes no call to the live API.
219
+ - [Documentation](https://docs.pomeloanalytics.com/en/getting-started/) for setup and API access.
220
+ - [Issues](https://github.com/pomeloanalytics/pomelo-js/issues) for SDK bugs, without tokens or private report data.
221
+ - [Contributing](https://github.com/pomeloanalytics/pomelo-js/blob/main/CONTRIBUTING.md) for local checks, examples and release preparation.
@@ -1089,6 +1089,11 @@ export interface components {
1089
1089
  }[];
1090
1090
  /** @enum {string} */
1091
1091
  include: "full";
1092
+ /**
1093
+ * @description One measurement method selected from the current period and reused for comparison.
1094
+ * @enum {string}
1095
+ */
1096
+ metric_method?: "legacy" | "web-vitals-6.2.3-cls1";
1092
1097
  pages: {
1093
1098
  avg_page_eng_time_ms: number;
1094
1099
  avg_scroll_depth?: number | null;
@@ -1101,6 +1106,11 @@ export interface components {
1101
1106
  pageviews: number;
1102
1107
  path_canon: string | null;
1103
1108
  performance?: {
1109
+ n_cls?: number;
1110
+ n_fcp?: number;
1111
+ n_inp?: number;
1112
+ n_lcp?: number;
1113
+ n_ttfb?: number;
1104
1114
  p75_cls: number | null;
1105
1115
  p75_fcp?: number | null;
1106
1116
  p75_inp: number | null;
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@pomeloanalytics/api",
3
- "version": "0.1.0-beta.1",
4
- "description": "Server-side TypeScript client for the Pomelo Analytics API.",
3
+ "version": "0.1.0-beta.3",
4
+ "description": "TypeScript client for reading Pomelo Analytics reports, sites and goals from Node.js servers.",
5
+ "homepage": "https://www.pomeloanalytics.com/",
6
+ "keywords": ["pomelo", "analytics", "web-analytics", "typescript", "nodejs", "sdk", "api-client"],
5
7
  "type": "module",
6
8
  "license": "MIT",
7
9
  "repository": {