Skip to content

Commit 71ab24d

Browse files
Version Packages
1 parent d58bb8f commit 71ab24d

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

.changeset/custom-mutation-builder.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# better-auth-convex
22

3+
## 0.4.2
4+
5+
### Patch Changes
6+
7+
- df53a30: Add support for custom mutation builders in `createClient` and `createApi`. Both functions now accept an optional `internalMutation` parameter, allowing you to wrap internal mutations with custom context (e.g., triggers, aggregates, middleware).
8+
9+
**Usage:**
10+
11+
```ts
12+
const internalMutation = customMutation(
13+
internalMutationGeneric,
14+
customCtx(async (ctx) => ({
15+
db: triggers.wrapDB(ctx).db,
16+
}))
17+
);
18+
19+
// Pass to createClient
20+
createClient({
21+
authFunctions,
22+
schema,
23+
internalMutation,
24+
triggers,
25+
});
26+
27+
// Pass to createApi
28+
createApi(schema, {
29+
...auth.options,
30+
internalMutation,
31+
});
32+
```
33+
334
## 0.4.1
435

536
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "better-auth-convex",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "Better Auth Convex local integration",
55
"keywords": [
66
"convex",

0 commit comments

Comments
 (0)