@theholocron/holocron-plugin-clerk 2.0.0-alpha.0 → 2.0.0-alpha.1

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 CHANGED
@@ -3,6 +3,12 @@
3
3
  Clerk plugin for [Holocron](../cli). Implements the `auth` capability
4
4
  against [Clerk's Backend REST API](https://clerk.com/docs/reference/backend-api).
5
5
 
6
+ ## Install
7
+
8
+ ```bash
9
+ pnpm add -D @theholocron/holocron-plugin-clerk@alpha
10
+ ```
11
+
6
12
  ## Auth
7
13
 
8
14
  Token resolution order:
@@ -12,7 +18,7 @@ Token resolution order:
12
18
  3. `CLERK_SECRET_KEY` env var (Clerk's own default; what their docs reference)
13
19
 
14
20
  > **Why not the `clerk` CLI?** Rando's adapter shells out to `npx clerk@latest
15
- > api …`, but the `clerk` CLI just wraps the same REST API holocron talks to.
21
+ api …`, but the `clerk` CLI just wraps the same REST API holocron talks to.
16
22
  > Direct REST drops a system-binary dependency and matches the uniform auth/REST
17
23
  > pattern across the other holocron plugins.
18
24
 
@@ -20,9 +26,9 @@ Token resolution order:
20
26
 
21
27
  ```jsonc
22
28
  {
23
- "providers": {
24
- "auth": "clerk"
25
- }
29
+ "providers": {
30
+ "auth": "clerk",
31
+ },
26
32
  }
27
33
  ```
28
34
 
@@ -32,17 +38,20 @@ for Development, `sk_live_*` for Production.
32
38
 
33
39
  ## What's implemented
34
40
 
35
- | Method | What it does |
36
- | ------------------------- | ----------------------------------------------------------------------------- |
37
- | `describe` | Declares `CLERK_PUBLISHABLE_KEY` + `CLERK_SECRET_KEY` as runtime envs |
38
- | `whoami` | `GET /users/count` reachability probe (returns user count) |
39
- | `ensureWebhookApp` | `POST /webhooks/svix` — idempotent; already-exists → `{alreadyExists:true}` |
40
- | `getWebhookDashboardUrl` | `POST /webhooks/svix_url` — deep-link to Svix dashboard |
41
- | `createUser` | `POST /users` — seeds users (test fixtures, admin bootstrap) |
41
+ | Method | What it does |
42
+ | ------------------------ | --------------------------------------------------------------------------- |
43
+ | `describe` | Declares `CLERK_PUBLISHABLE_KEY` + `CLERK_SECRET_KEY` as runtime envs |
44
+ | `whoami` | `GET /users/count` reachability probe (returns user count) |
45
+ | `ensureWebhookApp` | `POST /webhooks/svix` — idempotent; already-exists → `{alreadyExists:true}` |
46
+ | `getWebhookDashboardUrl` | `POST /webhooks/svix_url` — deep-link to Svix dashboard |
47
+ | `createUser` | `POST /users` — seeds users (test fixtures, admin bootstrap) |
42
48
 
43
49
  ## Status
44
50
 
45
- **v0.0.0 — first port.** Capability matches Rando's
46
- `adapters/clerk-cli.ts` surface plus a holocron-native `describe()`,
47
- all via direct REST against `api.clerk.com/v1`. No `clerk` CLI binary
48
- required on the operator's machine.
51
+ **`v2.0.0-alpha.0`**published on npm under the `alpha` dist-tag.
52
+ [Release notes](https://github.com/theholocron/holocron/releases/tag/v2.0.0-alpha.0).
53
+ APIs may still shift before stable v2.0.0.
54
+
55
+ Real Svix HMAC verification in `parseWebhook` is deferred to
56
+ [#80](https://github.com/theholocron/holocron/issues/80) — current
57
+ implementation validates shape only.
package/dist/index.d.mts CHANGED
@@ -38,7 +38,7 @@ interface RestClientOptions {
38
38
  baseUrl?: string;
39
39
  }
40
40
  interface RequestOptions {
41
- method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
41
+ method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
42
42
  body?: unknown;
43
43
  query?: Record<string, string>;
44
44
  }
package/dist/index.mjs CHANGED
@@ -127,7 +127,9 @@ var ClerkRestClient = class {
127
127
  constructor(opts) {
128
128
  this.token = opts.token;
129
129
  this.fetchImpl = opts.fetch ?? globalThis.fetch;
130
- this.baseUrl = (opts.baseUrl ?? "https://api.clerk.com/v1").replace(/\/+$/, "");
130
+ let url = opts.baseUrl ?? "https://api.clerk.com/v1";
131
+ while (url.endsWith("/")) url = url.slice(0, -1);
132
+ this.baseUrl = url;
131
133
  }
132
134
  async request(path, opts = {}) {
133
135
  const url = new URL(`${this.baseUrl}${path.startsWith("/") ? path : "/" + path}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-clerk",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.1",
4
4
  "description": "Holocron plugin for Clerk. Implements the auth capability against Clerk's Backend REST API.",
5
5
  "homepage": "https://github.com/theholocron/holocron/tree/main/packages/holocron-plugin-clerk#readme",
6
6
  "bugs": "https://github.com/theholocron/holocron/issues",
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "peerDependencies": {
24
- "@theholocron/cli": "2.0.0-alpha.0"
24
+ "@theholocron/cli": "2.0.0-alpha.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@theholocron/tsconfig": "^4.1.0",
@@ -32,7 +32,7 @@
32
32
  "typescript": "^5.9.3",
33
33
  "vitest": "^3.2.6",
34
34
  "tsdown": "^0.22.3",
35
- "@theholocron/cli": "2.0.0-alpha.0"
35
+ "@theholocron/cli": "2.0.0-alpha.1"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"