Skip to content

Commit

Permalink
docs: Embedded sdk (#30972)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpchev authored Nov 21, 2024
1 parent f58b529 commit 0b647b2
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions superset-embedded-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ using your app's authentication.

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

## Prerequisites

* Activate the feature flag `EMBEDDED_SUPERSET`
* 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.

## Embedding a Dashboard

Using npm:
Expand Down Expand Up @@ -108,6 +113,30 @@ Example `POST /security/guest_token` payload:
]
}
```

Alternatively, a guest token can be created directly in your app with a json like the following, and then signed
with the secret set in configuration variable `GUEST_TOKEN_JWT_SECRET` (see configuration file config.py)
```
{
"user": {
"username": "[email protected]",
"first_name": "embedded",
"last_name": "embedded"
},
"resources": [
{
"type": "dashboard",
"id": "d73e7841-9342-4afd-8e29-b4a416a2498c"
}
],
"rls_rules": [],
"iat": 1730883214,
"exp": 1732956814,
"aud": "superset",
"type": "guest"
}
```

### Sandbox iframe

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

0 comments on commit 0b647b2

Please sign in to comment.