github.com/unkeyed/sdks/tree/main/nextjs
Install
withUnkey
handler:
withUnkey
processes incoming requests, you can do so as follows:
getKey
By default, withUnkey will look for a bearer token located in the authorization
header. If you want to customize this, you can do so by passing a getter
in the configuration object:
onError
You can specify custom error handling. By default errors will be logged to the console, and withUnkey
will return a NextResponse with status 500.