Skip to content

Commit 0b647b2

Browse files
authored
docs: Embedded sdk (#30972)
1 parent f58b529 commit 0b647b2

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

superset-embedded-sdk/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ using your app's authentication.
2727

2828
Embedding is done by inserting an iframe, containing a Superset page, into the host application.
2929

30+
## Prerequisites
31+
32+
* Activate the feature flag `EMBEDDED_SUPERSET`
33+
* Set a strong password in configuration variable `GUEST_TOKEN_JWT_SECRET` (see configuration file config.py). Be aware that its default value must be changed in production.
34+
3035
## Embedding a Dashboard
3136

3237
Using npm:
@@ -108,6 +113,30 @@ Example `POST /security/guest_token` payload:
108113
]
109114
}
110115
```
116+
117+
Alternatively, a guest token can be created directly in your app with a json like the following, and then signed
118+
with the secret set in configuration variable `GUEST_TOKEN_JWT_SECRET` (see configuration file config.py)
119+
```
120+
{
121+
"user": {
122+
"username": "embedded@embedded.fr",
123+
"first_name": "embedded",
124+
"last_name": "embedded"
125+
},
126+
"resources": [
127+
{
128+
"type": "dashboard",
129+
"id": "d73e7841-9342-4afd-8e29-b4a416a2498c"
130+
}
131+
],
132+
"rls_rules": [],
133+
"iat": 1730883214,
134+
"exp": 1732956814,
135+
"aud": "superset",
136+
"type": "guest"
137+
}
138+
```
139+
111140
### Sandbox iframe
112141

113142
The Embedded SDK creates an iframe with [sandbox](https://developer.mozilla.org/es/docs/Web/HTML/Element/iframe#sandbox) mode by default

0 commit comments

Comments
 (0)