@strapi-community/plugin-better-auth-dashboard 1.0.0-alpha.6 → 1.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # Strapi + Better Auth Dashboard
2
+
3
+ An admin panel dashboard plugin for [Strapi](https://strapi.io) that provides user management, session monitoring, and analytics for [Better Auth](https://better-auth.com) authentication.
4
+
5
+ > [!CAUTION]
6
+ > This plugin is in BETA state. It is by no means considered stable and should not be used in production. If you want to contribute to its development, please contact any of the maintainers.
7
+
8
+ ## Features
9
+
10
+ - Overview page with user metrics, growth charts, and cohort retention analysis
11
+ - User management: search, create, edit, delete, and ban users
12
+ - Session management: view and revoke active sessions per user from the user detail drawer
13
+ - Organization management (when the Better Auth organization plugin is enabled)
14
+ - Real-time active user tracking (DAU / WAU / MAU)
15
+ - Automatic feature detection — ban, 2FA, email verification, and organization UI adapts to your Better Auth config
16
+
17
+ ## Installation
18
+
19
+ The additional dashboard plugin requires you to have the Better Auth plugin already installed and configured.
20
+
21
+ ### Packages
22
+
23
+ ```bash
24
+ npm install @better-auth/infra @strapi-community/plugin-better-auth-dashboard
25
+ # or
26
+ yarn add @better-auth/infra @strapi-community/plugin-better-auth-dashboard
27
+ # or
28
+ pnpm add @better-auth/infra @strapi-community/plugin-better-auth-dashboard
29
+ ```
30
+
31
+ ### Configuration
32
+
33
+ > [!CAUTION]
34
+ > This plugin only works if you have not changed the `basePath` of Better Auth. It needs to be the default `/api/auth` path.
35
+
36
+ In order to run this plugin you need to configure the `dash()` and `jwt()` plugins from Better Auth.
37
+
38
+ ```typescript title="src/lib/auth.ts"
39
+ import { dash } from "@better-auth/infra";
40
+ import { betterAuth } from 'better-auth';
41
+ import { jwt } from 'better-auth/plugins';
42
+ import { strapiAdapter } from '@strapi-community/plugin-better-auth';
43
+
44
+ export const auth = betterAuth({
45
+ database: strapiAdapter(),
46
+ trustedOrigins: ['http://localhost:3000'],
47
+ plugins: [
48
+ jwt(),
49
+ dash({
50
+ apiUrl: process.env.STRAPI_URL || "http://localhost:1337",
51
+ apiKey:
52
+ process.env.BETTER_AUTH_DASHBOARD_SECRET ||
53
+ "strapi-internal-dashboard-key",
54
+ }),
55
+ ],
56
+ advanced: {
57
+ database: {
58
+ generateId: 'serial',
59
+ },
60
+ },
61
+ emailAndPassword: {
62
+ enabled: true,
63
+ },
64
+ });
65
+ ```
66
+
67
+ ### Start Strapi
68
+
69
+ ```bash
70
+ pnpm develop
71
+ ```
72
+
73
+ The dashboard is now available in the Strapi admin panel.
74
+
75
+ ## Pages
76
+
77
+ | Tab | Description |
78
+ | --- | ----------- |
79
+ | **Overview** | User metrics, growth charts, cohort retention, active user rings |
80
+ | **Users** | Searchable user table with create, edit, delete, ban, and session revoke per user |
81
+ | **Organizations** | Organization list with member management (requires Better Auth `organization` plugin) |
82
+
83
+ ## Requirements
84
+
85
+ - `@strapi-community/plugin-better-auth` installed and configured
86
+ - Strapi v5.45.0+
87
+ - Better Auth >= 1.4.0
88
+
89
+ ## Resources
90
+
91
+ - [Documentation](https://strapi-community.github.io/plugin-better-auth/docs/better-auth/dashboard)
92
+ - [Better Auth Documentation](https://better-auth.com)
93
+ - [Strapi Documentation](https://docs.strapi.io)
94
+
95
+ ## Authors
96
+
97
+ - [Boaz Poolman](https://github.com/boazpoolman)
98
+
99
+ ## License
100
+
101
+ See the [LICENSE](./LICENSE.md) file for licensing information.
@@ -5,9 +5,9 @@ import { Modal, Typography, Button, Portal, Flex, IconButton, Box, Field, TextIn
5
5
  import styled, { keyframes } from "styled-components";
6
6
  import { dashClient } from "@better-auth/infra/client";
7
7
  import { createAuthClient, InferPlugin } from "better-auth/client";
8
+ import { g as getMediaLibraryComponent, a as getEditViewSidePanels, P as PluginIcon } from "./index-C83RGFES.mjs";
8
9
  import { Cross, Images, Trash, Plus, Pencil } from "@strapi/icons";
9
10
  import { useNotification, useFetchClient } from "@strapi/strapi/admin";
10
- import { g as getMediaLibraryComponent, P as PluginIcon } from "./index-DS5B1Klk.mjs";
11
11
  const dashPathMethods = () => ({
12
12
  id: "dash-path-methods",
13
13
  pathMethods: {
@@ -450,7 +450,8 @@ function UserCombobox({
450
450
  queryKey: ["user-combobox-search", search],
451
451
  queryFn: async () => {
452
452
  const whereClause = search ? JSON.stringify([
453
- { field: "email", operator: "contains", value: search }
453
+ { field: "email", operator: "contains", value: search, connector: "OR" },
454
+ { field: "name", operator: "contains", value: search, connector: "OR" }
454
455
  ]) : void 0;
455
456
  const result = await client.dash.listUsers({
456
457
  query: {
@@ -542,6 +543,7 @@ function CreateOrganizationDialog({ teamsEnabled, onClose }) {
542
543
  loading: createMutation.isLoading,
543
544
  disabled: !name || !slug || !ownerId,
544
545
  onClick: () => createMutation.mutate(),
546
+ "data-testid": "create-org-submit",
545
547
  children: "Create organization"
546
548
  }
547
549
  )
@@ -953,6 +955,21 @@ function CustomFieldsSection({
953
955
  )) })
954
956
  ] });
955
957
  }
958
+ function EditViewSidePanels({ model, documentId, document: document2 }) {
959
+ const panels = getEditViewSidePanels(model);
960
+ if (panels.length === 0) return null;
961
+ return /* @__PURE__ */ jsx(Fragment, { children: panels.map(({ id, title, Component }) => /* @__PURE__ */ jsxs(FormSection, { children: [
962
+ /* @__PURE__ */ jsx(SectionLabel, { children: title }),
963
+ /* @__PURE__ */ jsx(
964
+ Component,
965
+ {
966
+ model,
967
+ documentId,
968
+ document: document2
969
+ }
970
+ )
971
+ ] }, id)) });
972
+ }
956
973
  const SYSTEM_FIELDS = /* @__PURE__ */ new Set([
957
974
  "id",
958
975
  "documentId",
@@ -1138,6 +1155,7 @@ function OrganizationDetail({
1138
1155
  });
1139
1156
  qc.invalidateQueries({ queryKey: ["dash-org", organizationId] });
1140
1157
  qc.invalidateQueries({ queryKey: ["dash-organizations"] });
1158
+ qc.invalidateQueries({ queryKey: ["dash-strapi-org", organizationId] });
1141
1159
  setEditName(void 0);
1142
1160
  setEditSlug(void 0);
1143
1161
  setEditLogo(void 0);
@@ -1466,33 +1484,43 @@ function OrganizationDetail({
1466
1484
  }
1467
1485
  )
1468
1486
  ] }),
1469
- /* @__PURE__ */ jsx(EditSidebar, { children: /* @__PURE__ */ jsxs(FormSection, { children: [
1470
- /* @__PURE__ */ jsx(SectionLabel, { children: "Details" }),
1471
- /* @__PURE__ */ jsxs(
1472
- "div",
1487
+ /* @__PURE__ */ jsxs(EditSidebar, { children: [
1488
+ /* @__PURE__ */ jsxs(FormSection, { children: [
1489
+ /* @__PURE__ */ jsx(SectionLabel, { children: "Details" }),
1490
+ /* @__PURE__ */ jsxs(
1491
+ "div",
1492
+ {
1493
+ style: {
1494
+ display: "grid",
1495
+ gridTemplateColumns: "1fr 1fr",
1496
+ gap: 12
1497
+ },
1498
+ children: [
1499
+ /* @__PURE__ */ jsxs(MetaItem, { style: { gridColumn: "1 / -1" }, children: [
1500
+ /* @__PURE__ */ jsx(MetaKey, { children: "Organization ID" }),
1501
+ /* @__PURE__ */ jsx(MonoChip, { children: org?.id })
1502
+ ] }),
1503
+ /* @__PURE__ */ jsxs(MetaItem, { children: [
1504
+ /* @__PURE__ */ jsx(MetaKey, { children: "Members" }),
1505
+ /* @__PURE__ */ jsx(MetaVal, { children: org?.memberCount ?? 0 })
1506
+ ] }),
1507
+ /* @__PURE__ */ jsxs(MetaItem, { children: [
1508
+ /* @__PURE__ */ jsx(MetaKey, { children: "Created" }),
1509
+ /* @__PURE__ */ jsx(MetaVal, { children: org?.createdAt ? new Date(org.createdAt).toLocaleDateString() : "—" })
1510
+ ] })
1511
+ ]
1512
+ }
1513
+ )
1514
+ ] }),
1515
+ /* @__PURE__ */ jsx(
1516
+ EditViewSidePanels,
1473
1517
  {
1474
- style: {
1475
- display: "grid",
1476
- gridTemplateColumns: "1fr 1fr",
1477
- gap: 12
1478
- },
1479
- children: [
1480
- /* @__PURE__ */ jsxs(MetaItem, { style: { gridColumn: "1 / -1" }, children: [
1481
- /* @__PURE__ */ jsx(MetaKey, { children: "Organization ID" }),
1482
- /* @__PURE__ */ jsx(MonoChip, { children: org?.id })
1483
- ] }),
1484
- /* @__PURE__ */ jsxs(MetaItem, { children: [
1485
- /* @__PURE__ */ jsx(MetaKey, { children: "Members" }),
1486
- /* @__PURE__ */ jsx(MetaVal, { children: org?.memberCount ?? 0 })
1487
- ] }),
1488
- /* @__PURE__ */ jsxs(MetaItem, { children: [
1489
- /* @__PURE__ */ jsx(MetaKey, { children: "Created" }),
1490
- /* @__PURE__ */ jsx(MetaVal, { children: org?.createdAt ? new Date(org.createdAt).toLocaleDateString() : "—" })
1491
- ] })
1492
- ]
1518
+ model: "plugin::better-auth.organization",
1519
+ documentId: strapiOrgQuery.data?.documentId,
1520
+ document: strapiOrgQuery.data ?? void 0
1493
1521
  }
1494
1522
  )
1495
- ] }) })
1523
+ ] })
1496
1524
  ] }) }),
1497
1525
  /* @__PURE__ */ jsx(Tabs.Content, { value: "members", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 5, paddingTop: 6, children: [
1498
1526
  /* @__PURE__ */ jsxs(FormSection, { children: [
@@ -3689,11 +3717,8 @@ function useUsers(options = {}) {
3689
3717
  queryKey: ["dash-users", limit, offset, search],
3690
3718
  queryFn: async () => {
3691
3719
  const whereClause = search ? JSON.stringify([
3692
- {
3693
- field: "email",
3694
- operator: "contains",
3695
- value: search
3696
- }
3720
+ { field: "email", operator: "contains", value: search, connector: "OR" },
3721
+ { field: "name", operator: "contains", value: search, connector: "OR" }
3697
3722
  ]) : void 0;
3698
3723
  const result = await client.dash.listUsers({
3699
3724
  query: {
@@ -4572,7 +4597,15 @@ function UserDetailDrawer({
4572
4597
  }
4573
4598
  )
4574
4599
  ] })
4575
- ] })
4600
+ ] }),
4601
+ /* @__PURE__ */ jsx(
4602
+ EditViewSidePanels,
4603
+ {
4604
+ model: "plugin::better-auth.user",
4605
+ documentId: strapiUserQuery.data?.documentId,
4606
+ document: strapiUserQuery.data ?? void 0
4607
+ }
4608
+ )
4576
4609
  ] })
4577
4610
  ] }) }),
4578
4611
  /* @__PURE__ */ jsx(Tabs.Content, { value: "security", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 5, paddingTop: 6, children: [
@@ -7,9 +7,9 @@ const designSystem = require("@strapi/design-system");
7
7
  const styled = require("styled-components");
8
8
  const client$2 = require("@better-auth/infra/client");
9
9
  const client$1 = require("better-auth/client");
10
+ const index = require("./index-FaCDi-rw.js");
10
11
  const icons = require("@strapi/icons");
11
12
  const admin = require("@strapi/strapi/admin");
12
- const index = require("./index-DY_8hwEC.js");
13
13
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
14
14
  const styled__default = /* @__PURE__ */ _interopDefault(styled);
15
15
  const dashPathMethods = () => ({
@@ -454,7 +454,8 @@ function UserCombobox({
454
454
  queryKey: ["user-combobox-search", search],
455
455
  queryFn: async () => {
456
456
  const whereClause = search ? JSON.stringify([
457
- { field: "email", operator: "contains", value: search }
457
+ { field: "email", operator: "contains", value: search, connector: "OR" },
458
+ { field: "name", operator: "contains", value: search, connector: "OR" }
458
459
  ]) : void 0;
459
460
  const result = await client.dash.listUsers({
460
461
  query: {
@@ -546,6 +547,7 @@ function CreateOrganizationDialog({ teamsEnabled, onClose }) {
546
547
  loading: createMutation.isLoading,
547
548
  disabled: !name || !slug || !ownerId,
548
549
  onClick: () => createMutation.mutate(),
550
+ "data-testid": "create-org-submit",
549
551
  children: "Create organization"
550
552
  }
551
553
  )
@@ -957,6 +959,21 @@ function CustomFieldsSection({
957
959
  )) })
958
960
  ] });
959
961
  }
962
+ function EditViewSidePanels({ model, documentId, document: document2 }) {
963
+ const panels = index.getEditViewSidePanels(model);
964
+ if (panels.length === 0) return null;
965
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: panels.map(({ id, title, Component }) => /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { children: [
966
+ /* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { children: title }),
967
+ /* @__PURE__ */ jsxRuntime.jsx(
968
+ Component,
969
+ {
970
+ model,
971
+ documentId,
972
+ document: document2
973
+ }
974
+ )
975
+ ] }, id)) });
976
+ }
960
977
  const SYSTEM_FIELDS = /* @__PURE__ */ new Set([
961
978
  "id",
962
979
  "documentId",
@@ -1142,6 +1159,7 @@ function OrganizationDetail({
1142
1159
  });
1143
1160
  qc.invalidateQueries({ queryKey: ["dash-org", organizationId] });
1144
1161
  qc.invalidateQueries({ queryKey: ["dash-organizations"] });
1162
+ qc.invalidateQueries({ queryKey: ["dash-strapi-org", organizationId] });
1145
1163
  setEditName(void 0);
1146
1164
  setEditSlug(void 0);
1147
1165
  setEditLogo(void 0);
@@ -1470,33 +1488,43 @@ function OrganizationDetail({
1470
1488
  }
1471
1489
  )
1472
1490
  ] }),
1473
- /* @__PURE__ */ jsxRuntime.jsx(EditSidebar, { children: /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { children: [
1474
- /* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { children: "Details" }),
1475
- /* @__PURE__ */ jsxRuntime.jsxs(
1476
- "div",
1491
+ /* @__PURE__ */ jsxRuntime.jsxs(EditSidebar, { children: [
1492
+ /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { children: [
1493
+ /* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { children: "Details" }),
1494
+ /* @__PURE__ */ jsxRuntime.jsxs(
1495
+ "div",
1496
+ {
1497
+ style: {
1498
+ display: "grid",
1499
+ gridTemplateColumns: "1fr 1fr",
1500
+ gap: 12
1501
+ },
1502
+ children: [
1503
+ /* @__PURE__ */ jsxRuntime.jsxs(MetaItem, { style: { gridColumn: "1 / -1" }, children: [
1504
+ /* @__PURE__ */ jsxRuntime.jsx(MetaKey, { children: "Organization ID" }),
1505
+ /* @__PURE__ */ jsxRuntime.jsx(MonoChip, { children: org?.id })
1506
+ ] }),
1507
+ /* @__PURE__ */ jsxRuntime.jsxs(MetaItem, { children: [
1508
+ /* @__PURE__ */ jsxRuntime.jsx(MetaKey, { children: "Members" }),
1509
+ /* @__PURE__ */ jsxRuntime.jsx(MetaVal, { children: org?.memberCount ?? 0 })
1510
+ ] }),
1511
+ /* @__PURE__ */ jsxRuntime.jsxs(MetaItem, { children: [
1512
+ /* @__PURE__ */ jsxRuntime.jsx(MetaKey, { children: "Created" }),
1513
+ /* @__PURE__ */ jsxRuntime.jsx(MetaVal, { children: org?.createdAt ? new Date(org.createdAt).toLocaleDateString() : "—" })
1514
+ ] })
1515
+ ]
1516
+ }
1517
+ )
1518
+ ] }),
1519
+ /* @__PURE__ */ jsxRuntime.jsx(
1520
+ EditViewSidePanels,
1477
1521
  {
1478
- style: {
1479
- display: "grid",
1480
- gridTemplateColumns: "1fr 1fr",
1481
- gap: 12
1482
- },
1483
- children: [
1484
- /* @__PURE__ */ jsxRuntime.jsxs(MetaItem, { style: { gridColumn: "1 / -1" }, children: [
1485
- /* @__PURE__ */ jsxRuntime.jsx(MetaKey, { children: "Organization ID" }),
1486
- /* @__PURE__ */ jsxRuntime.jsx(MonoChip, { children: org?.id })
1487
- ] }),
1488
- /* @__PURE__ */ jsxRuntime.jsxs(MetaItem, { children: [
1489
- /* @__PURE__ */ jsxRuntime.jsx(MetaKey, { children: "Members" }),
1490
- /* @__PURE__ */ jsxRuntime.jsx(MetaVal, { children: org?.memberCount ?? 0 })
1491
- ] }),
1492
- /* @__PURE__ */ jsxRuntime.jsxs(MetaItem, { children: [
1493
- /* @__PURE__ */ jsxRuntime.jsx(MetaKey, { children: "Created" }),
1494
- /* @__PURE__ */ jsxRuntime.jsx(MetaVal, { children: org?.createdAt ? new Date(org.createdAt).toLocaleDateString() : "—" })
1495
- ] })
1496
- ]
1522
+ model: "plugin::better-auth.organization",
1523
+ documentId: strapiOrgQuery.data?.documentId,
1524
+ document: strapiOrgQuery.data ?? void 0
1497
1525
  }
1498
1526
  )
1499
- ] }) })
1527
+ ] })
1500
1528
  ] }) }),
1501
1529
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "members", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 5, paddingTop: 6, children: [
1502
1530
  /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { children: [
@@ -3693,11 +3721,8 @@ function useUsers(options = {}) {
3693
3721
  queryKey: ["dash-users", limit, offset, search],
3694
3722
  queryFn: async () => {
3695
3723
  const whereClause = search ? JSON.stringify([
3696
- {
3697
- field: "email",
3698
- operator: "contains",
3699
- value: search
3700
- }
3724
+ { field: "email", operator: "contains", value: search, connector: "OR" },
3725
+ { field: "name", operator: "contains", value: search, connector: "OR" }
3701
3726
  ]) : void 0;
3702
3727
  const result = await client.dash.listUsers({
3703
3728
  query: {
@@ -4576,7 +4601,15 @@ function UserDetailDrawer({
4576
4601
  }
4577
4602
  )
4578
4603
  ] })
4579
- ] })
4604
+ ] }),
4605
+ /* @__PURE__ */ jsxRuntime.jsx(
4606
+ EditViewSidePanels,
4607
+ {
4608
+ model: "plugin::better-auth.user",
4609
+ documentId: strapiUserQuery.data?.documentId,
4610
+ document: strapiUserQuery.data ?? void 0
4611
+ }
4612
+ )
4580
4613
  ] })
4581
4614
  ] }) }),
4582
4615
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "security", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 5, paddingTop: 6, children: [
@@ -32,12 +32,35 @@ const PluginIcon = ({
32
32
  },
33
33
  children: [
34
34
  /* @__PURE__ */ jsx("title", { children: "Better Auth Logo" }),
35
- /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M0 3.39v17.22h5.783v-5.55h6.434V8.939H5.783V3.39Zm12.217 5.55h5.638v6.122h-5.638v5.548H24V3.391H12.217Z" })
35
+ /* @__PURE__ */ jsx(
36
+ "path",
37
+ {
38
+ fill: "currentColor",
39
+ d: "M0 3.39v17.22h5.783v-5.55h6.434V8.939H5.783V3.39Zm12.217 5.55h5.638v6.122h-5.638v5.548H24V3.391H12.217Z"
40
+ }
41
+ )
36
42
  ]
37
43
  }
38
44
  );
39
45
  };
40
46
  const PLUGIN_ID = "better-auth-dashboard";
47
+ const panels = [];
48
+ function addEditViewSidePanel(config) {
49
+ if (panels.some((p) => p.id === config.id)) {
50
+ console.warn(
51
+ `[better-auth-dashboard] Panel with id "${config.id}" is already registered.`
52
+ );
53
+ return;
54
+ }
55
+ panels.push(config);
56
+ }
57
+ function getEditViewSidePanels(model) {
58
+ return panels.filter((p) => {
59
+ if (!p.model) return true;
60
+ if (Array.isArray(p.model)) return p.model.includes(model);
61
+ return p.model === model;
62
+ });
63
+ }
41
64
  function captureApp(app) {
42
65
  window.__betterAuthDashApp = app;
43
66
  }
@@ -47,6 +70,11 @@ function getMediaLibraryComponent() {
47
70
  const index = {
48
71
  register(app) {
49
72
  captureApp(app);
73
+ app.registerPlugin({
74
+ id: PLUGIN_ID,
75
+ name: "Auth Dashboard",
76
+ apis: { addEditViewSidePanel }
77
+ });
50
78
  app.addMenuLink({
51
79
  to: `/plugins/${PLUGIN_ID}`,
52
80
  icon: PluginIcon,
@@ -54,7 +82,7 @@ const index = {
54
82
  id: `${PLUGIN_ID}.plugin.name`,
55
83
  defaultMessage: "Auth Dashboard"
56
84
  },
57
- Component: async () => import("./Root-BHQUxF7-.mjs")
85
+ Component: async () => import("./Root-BvxYnCtW.mjs")
58
86
  });
59
87
  },
60
88
  bootstrap() {
@@ -62,6 +90,7 @@ const index = {
62
90
  };
63
91
  export {
64
92
  PluginIcon as P,
93
+ getEditViewSidePanels as a,
65
94
  getMediaLibraryComponent as g,
66
95
  index as i
67
96
  };
@@ -33,12 +33,35 @@ const PluginIcon = ({
33
33
  },
34
34
  children: [
35
35
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: "Better Auth Logo" }),
36
- /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "M0 3.39v17.22h5.783v-5.55h6.434V8.939H5.783V3.39Zm12.217 5.55h5.638v6.122h-5.638v5.548H24V3.391H12.217Z" })
36
+ /* @__PURE__ */ jsxRuntime.jsx(
37
+ "path",
38
+ {
39
+ fill: "currentColor",
40
+ d: "M0 3.39v17.22h5.783v-5.55h6.434V8.939H5.783V3.39Zm12.217 5.55h5.638v6.122h-5.638v5.548H24V3.391H12.217Z"
41
+ }
42
+ )
37
43
  ]
38
44
  }
39
45
  );
40
46
  };
41
47
  const PLUGIN_ID = "better-auth-dashboard";
48
+ const panels = [];
49
+ function addEditViewSidePanel(config) {
50
+ if (panels.some((p) => p.id === config.id)) {
51
+ console.warn(
52
+ `[better-auth-dashboard] Panel with id "${config.id}" is already registered.`
53
+ );
54
+ return;
55
+ }
56
+ panels.push(config);
57
+ }
58
+ function getEditViewSidePanels(model) {
59
+ return panels.filter((p) => {
60
+ if (!p.model) return true;
61
+ if (Array.isArray(p.model)) return p.model.includes(model);
62
+ return p.model === model;
63
+ });
64
+ }
42
65
  function captureApp(app) {
43
66
  window.__betterAuthDashApp = app;
44
67
  }
@@ -48,6 +71,11 @@ function getMediaLibraryComponent() {
48
71
  const index = {
49
72
  register(app) {
50
73
  captureApp(app);
74
+ app.registerPlugin({
75
+ id: PLUGIN_ID,
76
+ name: "Auth Dashboard",
77
+ apis: { addEditViewSidePanel }
78
+ });
51
79
  app.addMenuLink({
52
80
  to: `/plugins/${PLUGIN_ID}`,
53
81
  icon: PluginIcon,
@@ -55,12 +83,13 @@ const index = {
55
83
  id: `${PLUGIN_ID}.plugin.name`,
56
84
  defaultMessage: "Auth Dashboard"
57
85
  },
58
- Component: async () => Promise.resolve().then(() => require("./Root-BgL9lcCN.js"))
86
+ Component: async () => Promise.resolve().then(() => require("./Root-M8utGvhO.js"))
59
87
  });
60
88
  },
61
89
  bootstrap() {
62
90
  }
63
91
  };
64
92
  exports.PluginIcon = PluginIcon;
93
+ exports.getEditViewSidePanels = getEditViewSidePanels;
65
94
  exports.getMediaLibraryComponent = getMediaLibraryComponent;
66
95
  exports.index = index;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const index = require("./index-DY_8hwEC.js");
3
+ const index = require("./index-FaCDi-rw.js");
4
4
  exports.default = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "./index-DS5B1Klk.mjs";
1
+ import { i } from "./index-C83RGFES.mjs";
2
2
  export {
3
3
  i as default
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi-community/plugin-better-auth-dashboard",
3
- "version": "1.0.0-alpha.6",
3
+ "version": "1.0.0-alpha.8",
4
4
  "description": "Better Auth dashboard for the Strapi admin panel",
5
5
  "keywords": [
6
6
  "strapi",
@@ -11,13 +11,13 @@
11
11
  "license": "MIT",
12
12
  "author": {
13
13
  "name": "Boaz Poolman",
14
- "email": "boaz@pluginpal.io",
14
+ "email": "boaz.poolman@strapi.io",
15
15
  "url": "https://github.com/boazpoolman"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "git+https://github.com/strapi-community/plugin-better-auth.git",
20
- "directory": "packages/plugin-better-auth-dashboard"
20
+ "directory": "plugins/plugin-better-auth-dashboard"
21
21
  },
22
22
  "type": "commonjs",
23
23
  "exports": {
@@ -48,7 +48,8 @@
48
48
  "@types/node": "^22",
49
49
  "@types/react": "^18.0.0",
50
50
  "@types/styled-components": "^5.1.36",
51
- "typescript": "^5.9.3"
51
+ "typescript": "^5.9.3",
52
+ "@strapi-community/dev-utils": "0.0.1"
52
53
  },
53
54
  "peerDependencies": {
54
55
  "@better-auth/infra": "^0.2.6",
@@ -76,9 +77,9 @@
76
77
  "watch": "strapi-plugin watch",
77
78
  "dev": "strapi-plugin watch",
78
79
  "verify": "strapi-plugin verify",
79
- "test:ts:server": "cd server && tsc --noEmit",
80
- "test:ts:admin": "cd admin && tsc --noEmit",
81
- "check-types": "pnpm run test:ts:server && pnpm run test:ts:admin",
82
- "lint": "biome check --fix"
80
+ "lint:ts:server": "cd server && tsc --noEmit",
81
+ "lint:ts:admin": "cd admin && tsc --noEmit",
82
+ "lint": "biome check --fix",
83
+ "test:e2e": "playwright test"
83
84
  }
84
85
  }