diff --git a/.env.example b/.env.example index 1dcbb5fd4..cb0163ba3 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,16 @@ # Configurations +### API ### + +## API token to use when looking up the published content +# GITBOOK_TOKEN=xxx + +### URL of the application ### # NEXT_PUBLIC_GITBOOK_APP_URL=https://app.gitbook.com + +### Image resizing ### # GITBOOK_IMAGE_RESIZE_SIGNING_KEY=1234567890 # GITBOOK_IMAGE_RESIZE_URL=https://mycompany.com/cdn-cgi/image/ + +### SEO ### # GITBOOK_BLOCK_SEARCH_INDEXATION=true diff --git a/src/middleware.ts b/src/middleware.ts index c1bf91143..ddbb44302 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -47,6 +47,7 @@ export async function middleware(request: NextRequest) { const resolved = await withAPI( new GitBookAPI({ endpoint: apiEndpoint, + authToken: process.env.GITBOOK_TOKEN, }), () => lookupSpaceForURL(mode, inputURL, visitorAuthToken), );