supertokens / docs

SuperTokens documentation
40 stars 71 forks source link

Guide for Fastify and NestJs #770

Open arimgibson opened 9 months ago

arimgibson commented 9 months ago

Hi there!

The current documentation for using Supertokens with NestJs relies on the Nest server using Express.js, which is the default. However, there are massive performance gains to be found by using Fastify instead, and Nest natively supports choosing to use Fastify instead.

Two requests:

  1. The current documentation should explicitly state that it only covers NestJs running Express. The guide provided does not cover Fastify from what I've seen; standard functions break as it's trying to import Express-compatible middleware.
  2. Ideally, there would be a separate guide as well discussing how to implement Fastify with Nest. There are currently guides for implementing Fastify alone but I believe there's a lot of background information required to understand how to configure Nest and Fastify together with Supertokens.

I'm currently working on integrating Fastify, Nest, and Supertokens and will report any findings that could be beneficial to documentation or others here. I'm not an expert on any of these technologies, but if my solution can be confirmed by some others I would probably be willing to contribute to this documentation.

Thanks!