You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: daprdocs/content/en/js-sdk-docs/_index.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,45 @@ no_list: true
9
9
10
10
The Dapr JS SDK will allow you to interface with the Dapr process that abstracts several commonly used functionalities such as Service-to-Service invocation, State Management, PubSub, and more.
11
11
12
+
## Installation
13
+
14
+
To get started with the Javascript SDK, you can download the Dapr Javascript SDK package from [NPM](https://npmjs.org/package/dapr-client) by running the below:
15
+
16
+
```bash
17
+
npm install --save dapr-client
18
+
```
19
+
20
+
## Structure
21
+
22
+
The Dapr Javascript SDK exists out of 2 major components:
23
+
24
+
***DaprServer:** The Dapr Server manages all communication from the Dapr Sidecar to your application
25
+
***DaprClient:** The Dapr Client manages all communication from your application to the Dapr Sidecar
26
+
27
+
To achieve communication, you are able to choose between 2 different protocols that are implemented: gRPC or HTTP
28
+
29
+

30
+

31
+
32
+
## Get Started
33
+
34
+
To help you get started, feel free to check out the resources below:
12
35
13
36
<divclass="card-deck">
14
37
<divclass="card">
15
38
<div class="card-body">
16
39
<h5 class="card-title"><b>Client</b></h5>
17
-
<p class="card-text">Create a JavaScript client and interact with a Dapr sidecar and other Dapr applications.</p>
40
+
<p class="card-text">Create a JavaScript client and interact with a Dapr sidecar and other Dapr applications. (e.g. Publishing events, Output Binding support, ...)</p>
<p class="card-text">Create a JavaScript server and let the Dapr sidecar interact with your application. (e.g. Subscribing to events, Input Binding support, ...) </p>
description: JavaScript Client SDK for developing Dapr applications
7
7
---
8
8
9
+
## Introduction
10
+
11
+
The Dapr Client will allow you to perform communication with the Dapr Sidecar and get access to its client facing features such as: Publishing Events, Invoking Output Bindings, State Management, Secret Management, and much more.
dapr run --app-id <example-sdk> --app-port 50051 --app-protocol http npm run start
57
+
dapr run --app-id example-sdk --app-protocol http -- npm run start
57
58
58
59
# or, using npm script
59
60
npm run start:dapr-http
@@ -64,30 +65,25 @@ npm run start:dapr-http
64
65
Since HTTP is the default, you will have to adapt the communication protocol to use gRPC. You can do this by passing an extra argument to the client or server constructor.
dapr run --app-id <example-sdk> --app-port 50051 --app-protocol grpc npm run start
74
+
dapr run --app-id example-sdk --app-protocol grpc -- npm run start
75
75
76
76
# or, using npm script
77
77
npm run start:dapr-grpc
78
78
```
79
79
80
-
### DaprClient Library
81
-
A library that provides methods for how an application communicates with the Dapr sidecar.
82
-
83
-
### DaprServer Library
84
-
A library for how an application registers bindings / routes with Dapr. The `start()` method is used to start the server and bind the routes.
85
-
86
80
## Building blocks
87
81
88
-
The JavaScript SDK allows you to interface with all of the [Dapr building blocks]({{< ref building-blocks >}}).
82
+
The JavaScript Client SDK allows you to interface with all of the [Dapr building blocks]({{< ref building-blocks >}}) focusing on Client to Sidecar features.
0 commit comments