This example demonstrates how to use Bytebase service account to call Bytebase API.
- 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.local
to.env.local
.cp env-template.local .env.local
-
Update the
.env.local
file 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 Bytebase API endpoint:
/v1/auth/login
- To generate a token for service account.
For more details about Bytebase API, refer to official documentation.