Skip to content

Commit e0dd9b1

Browse files
authored
chore: CHARTS-3889 Updated all embedding urls (#11)
Updated URLs to use production charts apps instead of charts-dev. Updated Stitch sample to use production stitch app, no longer requiring an update to the base url
1 parent 236e519 commit e0dd9b1

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

examples/authenticated-custom-jwt/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ app.post("/login", (req, res) => {
2424
loginDetails.password === mockedPassword
2525
) {
2626
let token = jwt.sign({ username: loginDetails.username }, config.secret, {
27-
expiresIn: "24h" // expires in 24 hours
27+
expiresIn: "12h" // expires in 12 hours
2828
});
2929
res.json({ bearerToken: token });
3030
} else {

examples/authenticated-custom-jwt/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ async function login(username, password) {
5050
*/
5151
async function renderChart() {
5252
const sdk = new ChartsEmbedSDK({
53-
baseUrl: "https://charts-dev.mongodb.com/charts-test2-pebbp", // Optional: ~REPLACE~ with the Base URL from your Embed Chart dialog
53+
baseUrl: "https://charts.mongodb.com/charts-embedding-examples-wgffp", // Optional: ~REPLACE~ with the Base URL from your Embed Chart dialog
5454
getUserToken: async function() {
5555
return await login(getUser(), getPass());
5656
}
5757
});
5858

59-
const chart = sdk.createChart({ chartId: "a2e775e6-f267-4c2c-a65d-fbf3fad4a4f2" }); // Optional: ~REPLACE~ with the Chart ID from your Embed Chart dialog
59+
const chart = sdk.createChart({ chartId: "8d4dff93-e7ca-4ccd-a622-e20e8a100197" }); // Optional: ~REPLACE~ with the Chart ID from your Embed Chart dialog
6060

6161
// render the chart into a container
6262
chart.render(document.getElementById("chart"));

examples/authenticated-google/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@
2525
const id_token = googleUser.getAuthResponse().id_token;
2626
const ChartsEmbedSDK = window.ChartsEmbedSDK;
2727

28-
console.log("ID TOKEN == " + id_token);
2928
const sdk = new ChartsEmbedSDK({
30-
baseUrl: "https://charts-dev.mongodb.com/charts-test2-pebbp", // Optional: ~REPLACE~ with your Charts URL
29+
baseUrl: "https://charts.mongodb.com/charts-embedding-examples-wgffp", // Optional: ~REPLACE~ with your Charts URL
3130
getUserToken: () => id_token,
3231
});
3332

3433
const chart = sdk.createChart({
35-
chartId: "0d984f0c-5f1b-4711-9e5d-f78aa1ea8fcb", // Optional: ~REPLACE~ with your Chart ID
34+
chartId: "8d4dff93-e7ca-4ccd-a622-e20e8a100197", // Optional: ~REPLACE~ with your Chart ID
3635
});
3736

3837
document.body.classList.toggle("logged-in", true);

examples/authenticated-realm/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Your provider config, (ignoring the completed optional settings) should look som
126126
If you do not wish to use our sample data and have completed the above steps to prepare your own chart for embedding,
127127

128128
- Open the _index.js_ file (`src/index.js`)
129-
- Replace the Realm `baseUrl` string with the base URL for your Realm app
129+
- Replace the Realm `AppClientID` string with the base URL for your Realm app (look for "\~REPLACE\~" in the comments)
130130
- Replace the Charts `baseUrl` string with the base URL you copied from the MongoDB Charts Embedded Chart menu (look for "\~REPLACE\~" in the comments)
131131
- Replace the `chartId` string with the chart ID you copied from the MongoDB Charts Embedded Chart menu (look for "\~REPLACE\~" in the comments)
132132
- Replace the Stitch App ID in the Stitch Constructor, and remove the base URL. `Stitch.initializeAppClient('<your-app-id>')`

examples/authenticated-realm/src/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ import { Stitch, UserPasswordCredential } from 'mongodb-stitch-browser-sdk'
33
import "regenerator-runtime/runtime";
44

55
const client = Stitch.initializeAppClient(
6-
'realm-authentication-sample-eibkj', // Optional: ~REPLACE~ with your Realm App ID
7-
{
8-
baseUrl: 'https://stitch-dev.mongodb.com' // Optional: ~REPLACE~ with your Realm URL
9-
}
6+
'charts-embedding-sdk-nsuat', // Optional: ~REPLACE~ with your Realm App ID
107
);
118

129
function getUser() {
@@ -38,12 +35,12 @@ async function tryLogin() {
3835
client.auth.loginWithCredential(credential).then(() =>
3936
{
4037
const sdk = new ChartsEmbedSDK({
41-
baseUrl: "https://charts-dev.mongodb.com/charts-test2-pebbp", // Optional: ~REPLACE~ with your Charts URL
38+
baseUrl: "https://charts.mongodb.com/charts-embedding-examples-wgffp", // Optional: ~REPLACE~ with your Charts URL
4239
getUserToken: () => getRealmUserToken(client),
4340
});
4441

4542
const chart = sdk.createChart({
46-
chartId: "a2e775e6-f267-4c2c-a65d-fbf3fad4a4f2", // Optional: ~REPLACE~ with your Chart ID
43+
chartId: "e966910a-563d-40af-a0e6-57f9d7824c12", // Optional: ~REPLACE~ with your Chart ID
4744
});
4845

4946
chart.render(document.getElementById("chart"));

0 commit comments

Comments
 (0)