This is a sample app demonstrating how to use Bytebase API to fetch and filter audit logs.
- Node.js >= 18
- A running Bytebase instance
- Bytebase service account with appropriate permissions
- Follow the Self-host Bytebase via docker guide to set up Bytebase.
- Create a service account with the necessary permissions.
- Record the service account key.
-
Clone this repository.
-
Copy
env-template.localto.env.local.cp env-template.local .env.local
-
Update the
.env.localfile with your Bytebase host and service account details:NEXT_PUBLIC_BB_HOST=your_bytebase_host NEXT_PUBLIC_BB_SERVICE_ACCOUNT=your_service_account NEXT_PUBLIC_BB_SERVICE_KEY=your_service_key -
Install dependencies and run the development server:
pnpm i && pnpm dev -
Open http://localhost:3000 with your browser to see the running app.
This app demonstrates the use of the following Bytebase API endpoints:
/v1/auditLogs:search- To fetch audit logs for the whole workspace/v1/projects- To fetch all projects/v1/PROJECT_ID/auditLogs:search- To fetch audit logs for a specific project
For more details on the Bytebase API, refer to the official documentation.
