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
Visit https://docs.dapr.io/developing-applications/sdks/js/ to view the full documentation.
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.
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.
Please see our Contributing Overview.
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.
Please see CODE_OF_CONDUCT.md.