@datamatters-gmbh/urbanos-core
v0.3.0
Published
Framework-agnostic urbanOS client: auth, timeseries query builder, demo transport.
Downloads
174
Maintainers
Readme
@datamatters-gmbh/urbanos-core
The framework-agnostic urbanOS client: the Transport contract, UrbanOSClient,
HTTP and demo transports, OAuth token providers, the timeseries query builder, and
the classification + aggregation engines.
Zero runtime dependencies. ESM only.
Install
pnpm add @datamatters-gmbh/urbanos-corePublic npm — no registry config or token needed.
Use
import { HttpTransport, UrbanOSClient, PkceTokenProvider } from '@datamatters-gmbh/urbanos-core';
const auth = new PkceTokenProvider({
gatewayUrl: 'https://urbanos-gateway.udp.city',
shellUrl: 'https://urbanos.udp.city',
clientId: 'uos_c_abc123',
redirectUri: 'https://app.example.com/callback',
scopes: ['element:read', 'datasources:read', 'data:read:noise'],
});
const client = new UrbanOSClient(
new HttpTransport({ baseUrl: 'https://urbanos-gateway.udp.city', tokens: auth }),
);
const noise = await client
.timeseries(21)
.range({ last: '24h' })
.aggregate('avg', { bucket: '1h' })
.execute();Swap HttpTransport for DemoTransport to run offline — nothing else changes.
Docs
- Querying data — the client API
- Authentication — scopes, PKCE, embedded tokens
- API reference — every export
