83bc1c616 days ago22 lines · 656 B| 1 | import { createAuthClient } from "better-auth/react"; |
| 2 | import { ac, roles |
| 3 | import { organizationClient, usernameClient |
| 4 | import { apiKeyClient } |
| 5 | |
| 6 | import { API_URL } |
| 7 | |
| 8 | export const authClient = |
| 9 | baseURL: API_URL, |
| 10 | basePath: "/api/auth", |
| 11 | plugins: [ |
| 12 | usernameClient(), |
| 13 | apiKeyClient(), |
| 14 | // Mirrors the server's organization plugin, so the client knows the same roles. |
| 15 | organizationClient({ |
| 16 | ac, |
| 17 | roles, |
| 18 | teams: { enabled: true |
| 19 | dynamicAccessControl: { enabled: true |
| 20 | }), |
| 21 | ], |
| 22 | }); |