Skip to content

Commit 89d9e72

Browse files
update README and add components object to theme
2 parents b5b6f59 + 4cbd8ab commit 89d9e72

File tree

2 files changed

+41
-25
lines changed

2 files changed

+41
-25
lines changed

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
# Metabase Embedding SDK for React sample
1+
# Metabase embedding SDK for React sample application
22

33
You'll need a Pro or Enterprise version of Metabase 50 up and running. If you're not sure where to start, sign up for [Pro Cloud](https://www.metabase.com/pricing).
44

5-
> [!IMPORTANT]
6-
> The SDK is currently only compatible with Metabase 50
5+
> [!IMPORTANT]
6+
> The SDK is currently only compatible with Metabase v1.50 or higher
7+
8+
## Create `.env` file
79

8-
## Create .env file
910
```sh
1011
cp .env.example .env
1112
```
1213

1314
## Adjust URLs
15+
1416
In `.env`, make sure `REACT_APP_METABASE_INSTANCE_URL` and `METABASE_INSTANCE_URL` point to your Metabase instance URL, e.g. `http://localhost:3000`.
1517

1618
## Set up your Metabase
1719

20+
- [Run Metabase Pro on a Cloud plan (with a free trial)](https://www.metabase.com/pricing)
21+
- Run Metabase Enterprise Edition locally. This sample app is compatible with [Metabase version v1.50 or higher](https://www.metabase.com/docs/latest/releases). When running locally, you'll need to [activate your license](https://www.metabase.com/docs/latest/paid-features/activating-the-enterprise-edition) to enable SSO with JWT.
22+
1823
### Enable SSO with JWT
1924

2025
From any Metabase page, click on the **gear** icon in the upper right and select **Admin Settings** > **Settings** > **Authentication**.
@@ -23,56 +28,57 @@ On the card that says **JWT**, click the **Setup** button.
2328

2429
### JWT Identity provider URI
2530

26-
In **JWT IDENTITY PROVIDER URI** field, paste `localhost:9090/sso/metabase`.
31+
In **JWT IDENTITY PROVIDER URI** field, paste `localhost:9090/sso/metabase` (or substitute your Cloud URL for localhost).
2732

2833
### String used by the JWT signing key
2934

30-
Click the **Generate key** button. Copy the key and paste it in your `.env` file into the env var `METABASE_JWT_SHARED_SECRET`.
35+
Click the **Generate key** button. Copy the key and paste it in your `.env` file into the env var `METABASE_JWT_SHARED_SECRET`.
3136

3237
## Running the server
3338

34-
### Move into the directory
39+
Change into the `server` directory:
3540

3641
```sh
3742
cd server
3843
```
3944

40-
### Install packages
45+
Install packages:
4146

4247
```sh
4348
npm install
4449
```
4550

46-
### Starting the server
51+
Start the server:
4752

4853
```sh
4954
npm start
5055
```
5156

5257
## Start the client
5358

54-
### Move into the directory
59+
In a different terminal, change into the `client` directory:
5560

56-
In a different terminal
5761
```sh
5862
cd client
5963
```
60-
### Install dependencies
64+
65+
Install dependencies:
6166

6267
```sh
6368
npm install
6469
```
6570

66-
### Start the app
71+
Start the client app:
6772

6873
```sh
6974
npm start
7075
```
71-
Your browser should automatically open the app. By default, it runs on [http://localhost:3100](localhost:3100).
76+
77+
Your browser should automatically open the app. By default, the app runs on [http://localhost:3100](localhost:3100).
7278

7379
## Set up groups and data sandboxing
7480

75-
Check out our [quick start guide](https://www.metabase.com/learn/customer-facing-analytics/interactive-embedding-quick-start) to set up interactive embedding with JWT and data sandboxing.
81+
To set up interactive embedding with JWT and data sandboxing, check out our [quick start guide](https://www.metabase.com/learn/customer-facing-analytics/interactive-embedding-quick-start).
7682

7783
## Reporting issues
7884

client/src/App.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { MetabaseProvider, InteractiveQuestion } from "@metabase/embedding-sdk-react";
1+
import {
2+
MetabaseProvider,
3+
InteractiveQuestion,
4+
} from "@metabase/embedding-sdk-react";
25

36
// Configuration
47
const config = {
58
metabaseInstanceUrl: process.env.REACT_APP_METABASE_INSTANCE_URL,
6-
jwtProviderUri: process.env.REACT_APP_JWT_PROVIDER_URI
7-
}
9+
jwtProviderUri: process.env.REACT_APP_JWT_PROVIDER_URI,
10+
};
811

912
const questionId = 14;
1013

@@ -36,18 +39,25 @@ const theme = {
3639
shadow: "rgba(0,0,0,0.08)",
3740
},
3841

39-
table: {
40-
cell: {
41-
textColor: "#4C5773",
42+
components: {
43+
question: {
4244
backgroundColor: "#FFFFFF",
45+
textColor: "#4C5773",
4346
},
4447

45-
idColumn: {
46-
textColor: "#9B5966",
47-
backgroundColor: "#F5E9EB",
48+
table: {
49+
cell: {
50+
textColor: "#4C5773",
51+
backgroundColor: "#FFFFFF",
52+
},
53+
54+
idColumn: {
55+
textColor: "#9B5966",
56+
backgroundColor: "#F5E9EB",
57+
},
4858
},
4959
},
50-
}
60+
};
5161

5262
function App() {
5363
return (

0 commit comments

Comments
 (0)