Skip to content

Commit fa6ed68

Browse files
committed
api-embed-carousel
1 parent aa84a56 commit fa6ed68

File tree

5 files changed

+417
-8
lines changed

5 files changed

+417
-8
lines changed

embedding_qs_series_2_api_use_cases/.env

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ EMBED_URL_BASE=https://app.sigmacomputing.com
1515

1616
# Sigma Organization and Client Credentials
1717
# Update these with your actual organization and client credentials
18-
ORG_SLUG=
19-
CLIENT_ID=
20-
SECRET=
18+
ORG_SLUG=quick-starts-fundamentals
19+
CLIENT_ID=8f92dcde4c89a9cc56c8791b65e5862b71b5672ef6cb5a0d605564defa84a3af
20+
SECRET=f2794b7eb3876bd58c588e398305fce8f5d73001e5df66fd63de87b8fdef269f4ff8c3e279c09c51973c18262d144329f0f9eb4566382c8923acb50d3e9f6b9d
2121

2222
# =============================================================================
2323
# APPLICATION CONFIGURATION
@@ -37,7 +37,7 @@ WORKBOOK_NAME=Embed_API_QuickStart
3737
# USER PROVISIONING CONFIGURATION
3838
# =============================================================================
3939
# Admin user required for provisioning operations
40-
ADMIN_EMAIL=
40+
ADMIN_EMAIL=[email protected]
4141

4242
# Workspace configuration
4343
WORKSPACE_NAME=Embed_Users
@@ -69,7 +69,7 @@ HIDE_VIEW_SELECT=false
6969

7070
# Interface Configuration
7171
MENU_POSITION=none
72-
THEME=Lite
72+
THEME=Li
7373
LNG=English
7474

7575
# Responsive and Mobile Settings
@@ -79,4 +79,4 @@ RESPONSIVE_HEIGHT=false
7979

8080
# Page and View Targeting (leave empty for workbook-level embedding)
8181
PAGE_ID=
82-
VIEW_ID=
82+
VIEW_ID=
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
{
2-
"defaults": []
2+
"defaults": [
3+
{
4+
"userEmail": "[email protected]",
5+
"memberID": "Upf4cYouz5fAvk1SDH80L4pGihtUg",
6+
"workbookName": "Plugs Transactions",
7+
"workbookUrlId": "6QEnNYADhD50tbSnlwMltH",
8+
"createdAt": "2025-08-08T19:33:58.595Z",
9+
"updatedAt": "2025-08-08T19:33:58.595Z"
10+
}
11+
]
312
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# API Getting Started QuickStart
2+
3+
## Overview
4+
This is the foundational QuickStart page that demonstrates the basic Sigma embedding workflow using JWT authentication. It provides a simple interface to select users and workbooks, and displays the embedded Sigma content.
5+
6+
## Features
7+
- User Selection: Switch between View Users and Build Users to see different permission levels
8+
- Workbook Selection: Choose from available workbooks in your Sigma environment
9+
- JWT Token Display: View the generated JWT token and its decoded payload for learning purposes
10+
- Information Panel: Toggle sidebar showing embed URL, JWT token, and decoded JWT payload
11+
- Responsive Design: Clean, mobile-friendly interface
12+
13+
## How It Works
14+
15+
### Authentication Flow
16+
1. Select a user (View or Build user) from the dropdown
17+
2. Choose a workbook to embed
18+
3. The application generates a JWT token with appropriate claims for the selected user
19+
4. The JWT is used to authenticate and authorize the embedded Sigma content
20+
21+
### User Types
22+
- View Users: Can view and interact with the embedded content but cannot edit
23+
- Build Users: Have full editing capabilities within the embedded workbook
24+
25+
## Technical Implementation
26+
- JWT Generation: Uses `/api/jwt/api-getting-started` endpoint
27+
- Workbook Data: Fetches available workbooks from `/api/workbooks`
28+
- Environment Config: Loads configuration from `/env.json`
29+
- Debug Mode: Enable DEBUG=true in .env file for detailed console logging
30+
31+
## File Structure
32+
```
33+
api-getting-started/
34+
├── index.html # Main page with embedded Sigma content
35+
└── README.md # This documentation
36+
```
37+
38+
## API Endpoints Used
39+
- `GET /api/workbooks` - Fetches available workbooks
40+
- `POST /api/jwt/api-getting-started` - Generates JWT token for embedding
41+
42+
## Configuration
43+
The page respects all embedding configuration options from your `.env` file:
44+
- `hide_folder_navigation`
45+
- `hide_menu`
46+
- `menu_position`
47+
- `theme`
48+
- `lng` (language)
49+
- And other standard Sigma embedding parameters
50+
51+
## Getting Started
52+
1. Ensure your `.env` file is properly configured with Sigma API credentials
53+
2. Start the server: `npm start`
54+
3. Navigate to `/api-getting-started`
55+
4. Select a user and workbook to see the embedded content
56+
5. Use the Toggle Info Panel to view JWT details and debug information
57+
58+
## Debug Information
59+
When DEBUG=true is set in your environment:
60+
- Console logging shows detailed JWT information
61+
- Embed URL and token details are displayed in the sidebar
62+
- User selection and workbook loading events are logged
63+
64+
This QuickStart serves as the foundation for understanding Sigma embedding concepts before exploring more advanced features in the other API examples.

0 commit comments

Comments
 (0)