@pomeloanalytics/api 0.1.0-beta.1 → 0.1.0-beta.2
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 +6 -0
- package/README.md +30 -20
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.2
|
|
4
|
+
|
|
5
|
+
- Add the product website, documentation links and relevant npm keywords.
|
|
6
|
+
- Clarify server-side setup, the first `me()` call and report examples.
|
|
7
|
+
- Keep the API implementation and generated contract types unchanged.
|
|
8
|
+
|
|
3
9
|
## 0.1.0-beta.1
|
|
4
10
|
|
|
5
11
|
- 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
|
-
|
|
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
|
-
|
|
6
|
-
[
|
|
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
|
-
##
|
|
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',
|
|
@@ -183,20 +205,8 @@ identifier takes precedence in response metadata.
|
|
|
183
205
|
Response bodies retain API field names, including `snake_case`, `availability`,
|
|
184
206
|
and metering metadata. There is no cache, aggregation, or fallback endpoint.
|
|
185
207
|
|
|
186
|
-
##
|
|
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`.
|
|
208
|
+
## Help and contributions
|
|
199
209
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
210
|
+
- [Documentation](https://docs.pomeloanalytics.com/en/getting-started/) for setup and API access.
|
|
211
|
+
- [Issues](https://github.com/pomeloanalytics/pomelo-js/issues) for SDK bugs, without tokens or private report data.
|
|
212
|
+
- [Contributing](https://github.com/pomeloanalytics/pomelo-js/blob/main/CONTRIBUTING.md) for local checks, examples and release preparation.
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pomeloanalytics/api",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
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": {
|