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: source/get-started-embedding-sdk.txt
+56-28Lines changed: 56 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -106,8 +106,34 @@ Create a Web App
106
106
.. tab:: Dashboard
107
107
:tabid: dashboard
108
108
109
-
Proceed with the remaining steps to create a new app in
110
-
which to display your dashboard.
109
+
.. tabs::
110
+
:hidden: true
111
+
112
+
.. tab:: Unauthenticated
113
+
:tabid: unauthenticated
114
+
115
+
Proceed with the remaining steps to create a new app in
116
+
which to display your dashboard.
117
+
118
+
.. note::
119
+
120
+
MongoDB offers a :github:`pre-built example of an unauthenticated embedded dashboard </mongodb-js/charts-embed-sdk/tree/master/examples/dashboard/unauthenticated>`
121
+
in the GitHub Repository. This example shows how to use the
122
+
Embedding SDK to display an unauthenticated embedded dashboard.
123
+
124
+
.. tab:: Authenticated
125
+
:tabid: authenticated
126
+
127
+
Proceed with the remaining steps to create a new app in
128
+
which to display your dasbhoard.
129
+
130
+
.. note::
131
+
132
+
MongoDB offers :github:`examples of authenticated embedded dashboards </mongodb-js/charts-embed-sdk/tree/master/examples/dashboard/>`
133
+
in the GitHub Repository. These examples show you how to use
134
+
the Embedding SDK to authenticate an embedded dashboard using
135
+
:stitch:`MongoDB Realm </>`, Google, or |jwt| authentication
136
+
providers.
111
137
112
138
Add Embedding Code to Your App
113
139
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -205,51 +231,53 @@ To learn how to install the Embedding SDK into your app, see
205
231
.. tab:: Unauthenticated
206
232
:tabid: unauthenticated
207
233
208
-
Add the following code to your web app to execute where you
209
-
want your dashboard to render:
234
+
Add the following code to your web app to execute where you
235
+
want your dashboard to render.
210
236
211
237
.. note::
212
238
213
-
Replace the existing Dashboards Base URL and dashboard
214
-
ID with the values for the dashboard that you want to
215
-
display. Your Dashboards Base URL and dashboard ID are
216
-
visible in the embedding options modal window.
239
+
Replace the existing :guilabel:`Dashboards Base URL`
240
+
and dashboard ID with the values for the dashboard that
241
+
you want to display. Your :guilabel:`Dashboards Base URL`
242
+
and dashboard ID are visible in the embedding options
243
+
modal window.
217
244
218
245
.. code-block:: javascript
219
246
:copyable: false
220
247
221
248
import ChartsEmbedSDK from "@mongodb-js/charts-embed-dom";
222
249
223
250
const sdk = new ChartsEmbedSDK({
224
-
baseUrl: "https://charts.mongodb.com/charts-embedding-examples-wgffp", // ~REPLACE~ with the Base URL from your Embed Dashboard dialog.
251
+
baseUrl: "https://charts.mongodb.com/charts-embedding-examples-wgffp", // ~REPLACE~ with the Base URL from your Embed Dashboard dialog.
225
252
});
226
253
227
254
const chart = sdk.createChart({
228
-
dashboardId: "735cfa75-15b8-483a-bc2e-7c6659511c7c", // ~REPLACE~ with the Dashboard ID from your Embed Dashboard dialog.
229
-
height: "700px",
230
-
widthMode: "scale",
231
-
heightMode: "fixed"
232
-
// Additional options go here
255
+
dashboardId: "735cfa75-15b8-483a-bc2e-7c6659511c7c", // ~REPLACE~ with the Dashboard ID from your Embed Dashboard dialog.
0 commit comments