Database Hooks within a Plugin

Hi, I'm working on a custom plugin which requires intercepting and editing the user data when a user is created. This would be easier with a database hook, but I cannot find a way to do a database hook in a plugin. Is there a way of doing this? Thanks.
Solution:
you can pass init ```ts const plugin = { init: (ctx)=>{ return {...
Jump to solution
2 Replies
Solution
bekacru
bekacru4w ago
you can pass init
const plugin = {
init: (ctx)=>{
return {
context: {
databaseHooks: {} //
}
}
}
} satisfies BetterAuthPlugin;
const plugin = {
init: (ctx)=>{
return {
context: {
databaseHooks: {} //
}
}
}
} satisfies BetterAuthPlugin;
MrT Stephens
MrT StephensOP4w ago
Ahh ok this is exactly what i need. I thought it would have been in there somewhere. Thanks very much

Did you find this page helpful?