Skip to content
daprPublic

About

Dapr SDK for Javascript

Topics

Resources

Code of conduct

Stars

217 stars

Watchers

23 watching

Forks

Repository files navigation

Dapr SDK for JavaScript

NPM Version NPM Downloads GitHub Actions Workflow Status codecov GitHub License GitHub issue custom search in repo Discord YouTube Channel Views X (formerly Twitter) Follow

Getting Started

Instantly get started by installing the Dapr JS SDK and reading the getting started documentation or follow one of the quickstarts

npm install --save @dapr/dapr

You can also use the development version of the SDK which is built from the main branch. Make sure to remove the @dapr/dapr package first. This package is not meant for production use, and should only be used for development purposes.

npm install --save @dapr/dapr-dev

Documentation

Visit https://docs.dapr.io/developing-applications/sdks/js/ to view the full documentation.

Baggage propagation

Use withBaggage to attach W3C Baggage to outgoing DaprClient requests over HTTP or gRPC, without installing OpenTelemetry:

import { DaprClient, HttpMethod, withBaggage } from "@dapr/dapr";

const client = new DaprClient();
const result = await withBaggage({ "user-id": "12345", tenant: "acme" }, async () => {
  return await client.invoker.invoke("order-service", "orders", HttpMethod.GET);
});

The helper returns the callback's result and preserves baggage across await and other asynchronous work started in the callback. Concurrent contexts are isolated. Nested calls inherit outer entries and override matching keys; after the callback, the caller's context is unchanged. An empty object adds no entries.

Keys must be nonempty HTTP tokens; values must be unencoded strings and are percent-encoded for transmission. Invalid entries throw before the callback runs. Explicit request baggage headers take precedence over the context, and existing trace headers and API tokens are preserved. Dapr runtimes with baggage support forward it across service calls. This helper does not create spans, configure tracing, or automatically extract baggage from incoming requests. Avoid putting secrets or sensitive personal data in baggage.

Community

There are multiple ways to get involved with the SDK community, please see wiki/Community-engagement for more information.

The Dapr community can be found on Discord, where you can ask questions, propose features, and share your thoughts.

Contributing

Please see our Contributing Overview.

Good First Issues

We have a list of good first issues that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

Code of conduct

Please see CODE_OF_CONDUCT.md.

About

Dapr SDK for Javascript

Topics

Resources

Code of conduct

Stars

217 stars

Watchers

23 watching

Forks

Releases

Packages

Used by

Contributors

Languages