Accept a GITBOOK_TOKEN to fetch published content (#54)

This commit is contained in:
Samy Pessé
2023-12-20 16:04:44 +01:00
committed by GitHub
parent b11566dfb1
commit 2888b95b36
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -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
+1
View File
@@ -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),
);