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