A modern, React-based Confluence Cloud app that renders OpenAPI/Swagger documentation natively within Confluence pages. Display beautiful, interactive API documentation with filtering capabilities directly in your Confluence workspace.
- π― Native Integration - Seamlessly blends with Confluence's design system
- π± Responsive Design - Works perfectly on desktop and mobile devices
- π Smart Filtering - Filter by API tags or show individual endpoints
- π URL-Based - Load OpenAPI specs from any public URL
- β‘ Real-time Preview - See documentation before inserting into pages
- π Security Aware - Built-in warnings for private URL usage
- π Multiple Formats - Supports OpenAPI 3.0 and Swagger 2.0
- Install the app in your Confluence Cloud instance using the app descriptor URL
- Create or edit a Confluence page
- Insert macro by typing
/swaggeror using the macro browser - Configure URL - Enter your OpenAPI specification URL
- Choose filters (optional) - Select specific tags or endpoints
- Insert - Beautiful API documentation appears in your page
- Node.js 18+ and npm
- A Confluence Cloud instance (for testing)
- Netlify account (for hosting)
# Clone the repository
git clone https://github.com/reynldi/bring-swagger-to-confluence.git
cd swagger-confluence
# Install dependencies
npm install
# Start development server
npm run devThe app will be available at http://localhost:5173
swagger-confluence/
βββ public/
β βββ atlassian-connect.json # Confluence app descriptor
β βββ embed.html # Fallback embed page
βββ src/
β βββ components/ # React components
β β βββ ConfluenceMacroEditor.tsx
β β βββ ConfluenceMacroRenderer.tsx
β β βββ SwaggerRenderer.tsx
β β βββ ...
β βββ types/ # TypeScript definitions
β βββ data/ # Sample data
β βββ utils/ # Utility functions
βββ netlify/functions/ # Serverless functions
βββ ...
ConfluenceMacroEditor- Configuration interface for the macroConfluenceMacroRenderer- Displays the documentation in ConfluenceSwaggerRenderer- Core component that renders OpenAPI specsEndpointCard- Individual API endpoint documentation
# Development mode with hot reload
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Type checking
npm run type-check
# Linting
npm run lint-
Fork this repository to your GitHub account
-
Connect to Netlify:
- Go to Netlify
- Click "New site from Git"
- Connect your GitHub repository
- Set build command:
npm run build - Set publish directory:
dist
-
Configure Environment (optional):
# Set in Netlify dashboard under Site settings > Environment variables VITE_APP_NAME=Your App Name VITE_BASE_URL=https://your-site.netlify.app -
Update App Descriptor:
{ "baseUrl": "https://your-site.netlify.app", "name": "Your Swagger Documentation App" } -
Deploy: Netlify will automatically build and deploy your app
- Add custom domain in Netlify dashboard
- Update
baseUrlinatlassian-connect.json - Redeploy the application
-
Access Confluence Admin:
- Go to Confluence settings
- Navigate to "Manage apps"
- Click "Upload app"
-
Install App:
- Enter your app descriptor URL:
https://your-site.netlify.app/atlassian-connect.json - Click "Upload"
- Wait for installation to complete
- Enter your app descriptor URL:
-
Verify Installation:
- Create a test page
- Type
/swaggeror use macro browser - Configure with a public OpenAPI URL (e.g., Swagger Petstore)
Common Issues:
- 404 Error: Verify the app descriptor URL is accessible
- Installation Fails: Check that
baseUrlmatches your actual domain - Macro Not Found: Refresh Confluence page and try again
- Loading Issues: Ensure all HTTPS certificates are valid
The atlassian-connect.json file configures the Confluence integration:
{
"name": "Your App Name",
"key": "your-app-key",
"baseUrl": "https://your-domain.com",
"authentication": {
"type": "none"
},
"modules": {
"dynamicContentMacros": [...]
}
}Change App Name: Update name in atlassian-connect.json
Change App Key: Update key (must be unique across Atlassian ecosystem)
Styling: Modify Tailwind classes in components
Features: Add new filtering options or display modes
- Public URLs Only: This app fetches OpenAPI specs client-side
- URL Visibility: URLs are stored in Confluence page data and visible to page viewers
- No Authentication: The app doesn't handle authenticated API specs
- CORS Required: Target APIs must allow cross-origin requests
-
Use Public APIs Only: β
https://petstore3.swagger.io/api/v3/openapi.jsonβhttps://internal.company.com/api/spec.json -
Review URLs Before Publishing: Ensure no sensitive information in URLs
-
Use HTTPS: Always use secure URLs for OpenAPI specifications
-
Regular Updates: Keep dependencies updated for security patches
For internal/private APIs, consider:
- Deploying behind corporate firewall
- Implementing backend proxy service
- Adding authentication integration
- Using encrypted URL storage
-
Test with Public APIs:
https://petstore3.swagger.io/api/v3/openapi.json https://api.github.com/openapi.json -
Test Filtering:
- Load Petstore API
- Filter by "pet" tag
- Filter to single endpoint
-
Test in Confluence:
- Insert macro in different page types
- Test with different user permissions
- Verify mobile responsiveness
# Run type checking
npm run type-check
# Run linting
npm run lint
# Build test
npm run build1. Insert Swagger Documentation macro
2. URL: https://petstore3.swagger.io/api/v3/openapi.json
3. Filter: All endpoints
4. Insert β Complete Petstore API documentation1. Insert Swagger Documentation macro
2. URL: https://petstore3.swagger.io/api/v3/openapi.json
3. Filter: Specific tag β "pet"
4. Insert β Only pet-related endpoints1. Insert Swagger Documentation macro
2. URL: https://petstore3.swagger.io/api/v3/openapi.json
3. Filter: Single endpoint β "PUT /pet - Update existing pet"
4. Insert β Just the update pet documentationWe welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Use TypeScript for type safety
- Follow existing code style and formatting
- Add comments for complex logic
- Update documentation for new features
Please use GitHub Issues to report bugs or request features:
- Include steps to reproduce bugs
- Provide example OpenAPI URLs when relevant
- Specify Confluence version and browser details
This project is licensed under the MIT License - see the LICENSE file for details.
- Atlassian Connect: Developer Documentation
- OpenAPI Specification: Official Docs
- React: Official Docs
