Skip to content

TrogonEventStore Node.js Client

CI

Community-maintained TypeScript and JavaScript gRPC client for TrogonEventStore.

Packages

Package Purpose
@trogonstack/trogon-eventstore-client Database client
@trogonstack/trogon-eventstore-opentelemetry OpenTelemetry instrumentation

Packages are published to GitHub Packages. Configure the @trogonstack npm scope before installing:

@trogonstack:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
npm install @trogonstack/trogon-eventstore-client

Do not commit registry credentials or tokens.

Quick start

import {
  jsonEvent,
  NO_STREAM,
  TrogonEventStoreClient,
} from "@trogonstack/trogon-eventstore-client";

const client = TrogonEventStoreClient.connectionString(
  "esdb://localhost:2113?tls=false"
);

await client.appendToStream(
  "orders-1",
  jsonEvent({ type: "OrderCreated", data: { orderId: "1" } }),
  { streamState: NO_STREAM }
);

Development

corepack enable
yarn install --immutable
yarn build
yarn lint

Integration tests use ghcr.io/trogonstack/trogoneventstore:ci by default. Override it with TROGON_EVENTSTORE_IMAGE.

License

Licensed under Apache-2.0. This derivative preserves the original copyright notice and identifies modifications by Straw Hat, LLC in LICENSE.

About

TrogonEventStore Node.js and TypeScript client

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages