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
/swagger
or 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 dev
The 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
baseUrl
inatlassian-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
/swagger
or 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
baseUrl
matches 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 build
1. Insert Swagger Documentation macro
2. URL: https://petstore3.swagger.io/api/v3/openapi.json
3. Filter: All endpoints
4. Insert → Complete Petstore API documentation
1. Insert Swagger Documentation macro
2. URL: https://petstore3.swagger.io/api/v3/openapi.json
3. Filter: Specific tag → "pet"
4. Insert → Only pet-related endpoints
1. 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 documentation
We 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