index/classes/EventsQueryService.md
Reads stored events and their statistics (Admin API key or Overseer JWT).
Example
const events = new EventsQueryService(httpClient, undefined, jwtAuth);
const stats = await events.getEventStats();
const page = await events.queryEvents({ eventTypes: ['token_buy'], page: 1, limit: 50 });
Extends
StreamTokenServiceBase
stream token service base
Constructors
Constructor
new EventsQueryService(
http,adminApiKey?,jwtAuth?,debugMode?,userApiKey?):EventsQueryService
Parameters
| Parameter | Type |
|---|---|
http | HttpClient |
adminApiKey? | string |
jwtAuth? | JwtAuth |
debugMode? | boolean |
userApiKey? | string |
Returns
EventsQueryService
Overrides
StreamTokenServiceBase.constructor
admin api key jwt auth debug mode user events query service http client stream token base
Methods
getEventStats()
getEventStats():
Promise<EventStats>
Aggregate event statistics for the dashboard cards.
Returns
Promise<EventStats>
Throws
ConfigurationError when neither an admin API key nor a JWT is configured
Throws
NetworkError when the request fails or the body is not the statistics shape
Since
9.0.0
get event stats
queryEvents()
queryEvents(
options?):Promise<QueryEventsResult>
One page of stored events (offset paging: page, limit).
Only the filters given are sent. eventTypes / categories go as repeated array parameters.
Parameters
| Parameter | Type |
|---|---|
options? | QueryEventsOptions |
Returns
Promise<QueryEventsResult>
Throws
ValidationError for a limit outside 1..100, a page below 1 or an unknown sort / preset / source
Throws
ConfigurationError when neither an admin API key nor a JWT is configured
Throws
NetworkError when the request fails or the body is not the events shape
Since
9.0.0
query events result event types options
setJwtAuth()
setJwtAuth(
jwtAuth):void
Set the JWT authentication manager
This allows dynamic configuration of JWT auth after service creation.
Parameters
| Parameter | Type | Description |
|---|---|---|
jwtAuth | JwtAuth | JWT auth manager instance |
Returns
void
Inherited from
StreamTokenServiceBase.setJwtAuth
set jwt auth stream token service base