Database Hooks `before.create` Has Undefined Context

How is the context populated in the database before create hook?

Taken from example here https://www.better-auth.com/docs/concepts/database#1-before-hook

Code snippet below:
databaseHooks: {
  session: {
    create: {
      before: async (session, context) => {
        // context is always undefined here

        return {
          data: session
        }
      },
    }
  }
},
Learn how to use a database with Better Auth.
Was this page helpful?