@socialgouv/matomo-postgres
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

@socialgouv/matomo-postgres

header

Extract matomo data from Live.getLastVisitsDetails API and push events and visits informations to Postgres.

Usage

Run the following job with correct environment variables.

npx @socialgouv/matomo-postgres

Environment variables Deployment

name value
MATOMO_KEY* matomo api token
MATOMO_SITE* matomo site id
MATOMO_URL* matomo url
PGDATABASE* Postgres connection string
DESTINATION_TABLE matomo
STARTDATE default to today()
RESULTPERPAGE matomo pagination (defaults to 500)
INITIAL_OFFSET How many days to fetch on initialisation (defaults to 3)

Dev

docker-compose up
export MATOMO_URL=
export MATOMO_SITE=
export MATOMO_KEY=
export DESTINATION_TABLE= # optional
export STARTDATE= # optional
export OFFSET= # optional
export PGDATABASE=postgres://postgres:postgres@127.0.0.1:5455/postgres
yarn start

Use yarn test -u to update the snapshots

Database migrations

yarn migrate is run on each yarn start with Kysely migrations at ./src/migrations

Readme

Keywords

none

Package Sidebar

Install

npm i @socialgouv/matomo-postgres

Weekly Downloads

2,186

Version

2.0.1

License

Apache-2.0

Unpacked Size

41 kB

Total Files

16

Last publish

Collaborators

  • revolunet
  • socialgroovybot