If you aren't sure what an option does, it's best to leave it set to the default.
The theme of the docs. Currently, the only included theme is the default.
Output folder. The docs, Postman collection and OpenAPI spec will be placed in this folder.
The base URL to be displayed in the docs.
<title> for the generated documentation, and the name of the generated Postman collection and OpenAPI spec.
A description for your API. This will be placed in the "Introduction" section, before the
introText. It will also be used as the
info.description field in the generated Postman collection and OpenAPI spec.
The text to place in the "Introduction" section (after the
description). Markdown and HTML are supported.
Configure the API tester included in the docs.
enabled: Set this to
trueif you'd like Scribe to add a "Try It Out" button to your endpoints so users can test them from their browser.
baseUrl: The base URL where Try It Out requests should go to. For instance, you can set this to your staging server.
Path to an image to use as your logo in the docs. This will be used as the value of the
src attribute for the
<img> tag, so make sure it points to a public URL or path accessible from your server.
If you're using a relative path, remember to make it relative to your docs output location (
static type). For example, if your logo is in
For best results, the image width should be 230px. Set this to
false if you're not using a logo.
When documenting your api, you use
@group annotations to group API endpoints. Endpoints which do not have a group annotation will be grouped under the
For each endpoint, an example request is shown in each of the languages specified in this array. Currently, only
bash (curl) and
Along with the HTML docs, Scribe can automatically generate a Postman collection for your API. This section is where you can configure or disable that. The collection will be created in
enabled: Whether or not to generate a Postman API collection.
overrides: Fields to merge with the collection after generating. Dot notation is supported. For instance, if you'd like to override the
infoobject, you can set
Scribe can also generate an OpenAPI (Swagger) spec for your API. This section is where you can configure or enable that. The spec will be created in
The OpenAPI spec is an opinionated spec that doesn't cover all features of APIs in the wild (such as optional URL parameters). Scribe does its best, but there's no guarantee that the spec generated will exactly match your API structure.
enabled: Whether or not to generate an OpenAPI spec.
overrides: Fields to merge with the spec after generating. Dot notation is supported. For instance, if you'd like to override the
infoobject, you can set
Specify authentication details about your API. This information will be used:
- to derive the text in the "Authentication" section in the generated docs
- to generate auth info in the Postman collection and OpenAPI spec
- to add the auth headers/query parameters/body parameters to the docs and example requests
- to set the auth headers/query parameters/body parameters for response calls
Here are the available settings:
enabled: Set this to
trueif any endpoints in your API use authentication.
default: Specify the default auth behaviour of your API.
If you set this to
true, all your endpoints will be considered authenticated by default, and you can opt out individually with the
If you set this to
false, your endpoints will not be authenticated by default, and you can turn on auth individually with the
Even if you set
auth.default, you must also set
true if you have at least one endpoint that is authenticated!
in: Where is the auth value meant to be sent in a request? Options:
query(for a query parameter)
body(for a body parameter)
basic(for HTTP Basic auth via an Authorization header)
bearer(for HTTP Bearer auth via an Authorization header)
header(for auth via a custom header)
name: The name of the parameter (eg
apiKey) or header (eg
inis set to
basic, this value will be ignored, and the header used will be
useValue: The value of the parameter to be used by Scribe to authenticate response calls, or a function that will be called to get that value. This will not be included in the generated documentation. If this is empty, Scribe will use a randomly generated value.
placeholder: The placeholder your users will see for the auth parameter in the example requests. If this is empty, Scribe will generate a realistic-looking auth token instead (for example, "jh86fccvbAx6CmA9VS").
extraInfo: Any extra authentication-related info for your users. For instance, you can describe how to find or generate their auth credentials. Markdown and HTML are supported. This will be included in the
routes section is an array of items describing what routes in your application that should be included in the docs.
Each item in the
routes array is a route group. A route group is an array containing:
- rules defining what routes belong in that group (
- any custom settings to apply to those routes (
This is where you tell Scribe the endpoints you want to be a part of that group, by specifying patterns matching their paths.
include adds endpoints to the group, while
exclude removes endpoints. You can use
* as a wildcard to mean "anything". For instance, this config tells Scribe to include all routes starting with
api/, but exclude those starting with
The default config has
['*'], meaning all endpoints will be included.
apply section of the route group is where you specify any additional settings to be applied to those routes when generating documentation. There are a number of settings you can tweak here:
headers: Any headers you specify here will be added in example requests and response calls. Headers are specified as
response_calls: These are the settings that will be applied when making "response calls".
baseUrlkey is the base URL Scribe will make requests to. Typically, this should be the URL (+ port) your app runs on locally (such as
methodskey determines what endpoints allow response calls. By default, Scribe will only try response calls for GET endpoints, but you can change this as you wish. Set it to
['*']to mean all methods. Leave it as an empty array to turn off response calls for that route group.
fileParamskeys allow you to set specific data to be sent in response calls. For file parameters, each value should be a valid path (absolute or relative to your project directory) to a file on the machine.
envkey allows you to set specific env variables for the response call.
By splitting your routes into groups, you can apply different settings to different routes.
When generating examples for parameters, this package uses the faker.js package to generate random values. If you would like the package to generate the same example values each time, set this to any number (eg.
Alternatively, you can set example values for parameters when documenting them.