-
Q: How do we make sure that a required recipe is installed (backend)?
-
A: When overring a recipe, set the
recipeInitRequired
field totrue
-
Q: How do i add authorization?
-
A: You can use the
getAuthorisedUserId
orisAUthroised
utility from./utils
- Throwing an error inside a handler will crash the server
- Standardised error handling
- Path matching in handlers. This means would allow REST style paths
- Defined a better structure and better conventions for plugins.
- Enforce guidelines
- Every plugin should have both/either folders:
backend
,frontend
- Backend plugins should have the mininum file strucutre:
backend/lib/tsconfig.json
- TypeScript config for building the backend plugin.backend/lib/build
- will the built sources of the plugin.backend/lib/ts
- plugin source files.backend/lib/ts/config.ts
- contains various plugin configurations. At minimum it should contain and exportPLUGIN_ID
- unique identifier of the plugin.backend/lib/ts/plugin.ts
- contains and exports theinit
plugin method - It initialises the plugin and returns a config object that implementsSuperTokensPlugin
from thesupertokens-node/types
package.backedn/lib/ts/utils
- contains some commonly used methods for doing basic authorisation, loggin, etc.backend/lib/ts/index.ts
- exports theinit
method andPLUGIN_ID
.
- As this will be a continuolsy evolvong repo, all changes to structure, best practices, conventions, etc SHOULD be documented
- Preferably, they should also be enforce through linters, build rules, commit hooks, etc