Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit 728ce5c

Browse files
authored
Merge pull request #31 from udecode/changeset-release/main
2 parents 91aaf8f + 930d799 commit 728ce5c

3 files changed

Lines changed: 111 additions & 112 deletions

File tree

.changeset/upgrade-0-10.md

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

CHANGELOG.md

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

3+
## 0.5.0
4+
5+
### Minor Changes
6+
7+
- [#30](https://github.com/udecode/better-auth-convex/pull/30) [`cc1ca02`](https://github.com/udecode/better-auth-convex/commit/cc1ca028d8f494e25a53555fe4b9fe120b895ced) Thanks [@zbeyens](https://github.com/zbeyens)! - ### @convex-dev/better-auth 0.10
8+
9+
This release updates better-auth-convex to work with `@convex-dev/better-auth@0.10.4` and `better-auth@1.4.7`.
10+
11+
For the upstream migration guide, see: https://labs.convex.dev/better-auth/migrations/migrate-to-0-10
12+
13+
### Breaking Changes
14+
15+
#### `createApi` signature changed
16+
17+
The second parameter is now `createAuth` function instead of spread auth options:
18+
19+
```ts
20+
// Before
21+
export const { create, ... } = createApi(schema, {
22+
...auth.options,
23+
skipValidation: true,
24+
});
25+
26+
// After
27+
export const { create, ... } = createApi(schema, createAuth, {
28+
skipValidation: true,
29+
});
30+
```
31+
32+
#### `authClient.adapter` signature changed
33+
34+
Now takes `createAuthOptions` function instead of options object:
35+
36+
```ts
37+
// Before
38+
database: authClient.adapter(ctx, auth.options),
39+
40+
// After
41+
database: authClient.adapter(ctx, createAuthOptions),
42+
```
43+
44+
#### `createAuth` pattern replaced
45+
46+
The static `auth` instance with `optionsOnly` is replaced by `createAuthOptions` factory:
47+
48+
```ts
49+
// Before
50+
export const createAuth = (ctx, { optionsOnly } = { optionsOnly: false }) => {
51+
return betterAuth({ ... });
52+
};
53+
export const auth = createAuth({}, { optionsOnly: true });
54+
55+
// After
56+
export const createAuthOptions = (ctx) => ({
57+
baseURL: process.env.SITE_URL!,
58+
plugins: [convex({ authConfig, jwks: process.env.JWKS })],
59+
// ...
60+
}) satisfies BetterAuthOptions;
61+
62+
export const createAuth = (ctx) => betterAuth(createAuthOptions(ctx));
63+
```
64+
65+
### New Features
66+
67+
#### Static JWKS exports
68+
69+
`createApi` now exports `getLatestJwks` and `rotateKeys` for static JWKS management:
70+
71+
```ts
72+
export const {
73+
create,
74+
// ... other exports
75+
getLatestJwks,
76+
rotateKeys,
77+
} = createApi(schema, createAuth, { skipValidation: true });
78+
```
79+
80+
After deploying, generate JWKS:
81+
82+
```bash
83+
npx convex run auth:getLatestJwks | npx convex env set JWKS
84+
```
85+
86+
### Migration Steps
87+
1. Update dependencies:
88+
89+
```bash
90+
pnpm add better-auth@1.4.7 @convex-dev/better-auth@0.10.4
91+
```
92+
93+
2. Update `convex/auth.config.ts`:
94+
95+
```ts
96+
export default {
97+
providers: [getAuthConfigProvider({ jwks: process.env.JWKS })],
98+
} satisfies AuthConfig;
99+
```
100+
101+
3. Update `convex/auth.ts`:
102+
- Replace `auth` static instance with `createAuthOptions` factory
103+
- Update `createApi` call signature
104+
- Update `getAuth` to use `createAuthOptions`
105+
- Add `getLatestJwks` and `rotateKeys` to exports
106+
4. Deploy and generate JWKS:
107+
```bash
108+
npx convex run auth:getLatestJwks | npx convex env set JWKS
109+
```
110+
111+
See the [README](https://github.com/udecode/better-auth-convex) for complete setup examples.
112+
3113
## 0.4.9
4114

5115
### 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.9",
3+
"version": "0.5.0",
44
"description": "Better Auth Convex local integration",
55
"keywords": [
66
"convex",

0 commit comments

Comments
 (0)