The entire server API specification is available through a web interface and as an OpenAPI JSON. You can use the Swagger web interface for manual testing of the API on the hosted authentication server. Do not forget to enter the API key first through the Authorize button.
We recommend using an automatically generated library to integrate the nextAuth REST SDK into your application, instead of manually implementing the REST calls as described in the Swagger documentation.
We provide prepackaged SDK code for the following languages:
- TypeScript Angular
- TypeScript AngularJS
- TypeScript Fetch
- TypeScript jQuery
- TypeScript Node
Generating an SDK⚓︎
Since the nextAuth SDK is entirely based on OpenAPI, you can easily generate an SDK for any language supported by Swagger Codegen.
First, download the Swagger Codegen CLI.
curl -LO https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.5/swagger-codegen-cli-2.4.5.jar
Next, get the nextAuth Swagger specification.
curl -LO https://api.doc.nextauth.com/api/swagger.yaml
Finally, generate your SDK!
java -jar swagger-codegen-cli-2.4.5.jar generate -l erlang -i swagger.yaml -o nextauth-client-erlang
In this example, we create an Erlang SDK. Check the Swagger Codegen documentation for supported languages and options.