|
| 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