@deverjak/tenantkit-adapter-supabase 0.1.1 → 0.1.2

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/dist/env.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Supabase adapter env — validated once, fail-fast. The publishable key is named per the conventional
3
- * `SUPABASE_ANON_KEY` (the reference apps used a non-standard name; we normalize it here).
2
+ * Supabase adapter env — validated once, fail-fast. Accepts BOTH key namings: the new Supabase keys
3
+ * (`SUPABASE_PUBLISHABLE_KEY` / `SUPABASE_SECRET_KEY`, incl. their `NEXT_PUBLIC_*` variants) and the legacy
4
+ * `SUPABASE_ANON_KEY` / `SUPABASE_SERVICE_ROLE_KEY`. Internally both collapse to the same two fields.
4
5
  */
5
6
  import { z } from 'zod';
6
7
  declare const Schema: z.ZodObject<{
package/dist/env.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Supabase adapter env — validated once, fail-fast. The publishable key is named per the conventional
3
- * `SUPABASE_ANON_KEY` (the reference apps used a non-standard name; we normalize it here).
2
+ * Supabase adapter env — validated once, fail-fast. Accepts BOTH key namings: the new Supabase keys
3
+ * (`SUPABASE_PUBLISHABLE_KEY` / `SUPABASE_SECRET_KEY`, incl. their `NEXT_PUBLIC_*` variants) and the legacy
4
+ * `SUPABASE_ANON_KEY` / `SUPABASE_SERVICE_ROLE_KEY`. Internally both collapse to the same two fields.
4
5
  */
5
6
  import { z } from 'zod';
6
7
  const Schema = z.object({
@@ -15,8 +16,13 @@ export function supabaseEnv() {
15
16
  return cached;
16
17
  const parsed = Schema.safeParse({
17
18
  SUPABASE_URL: process.env.SUPABASE_URL ?? process.env.NEXT_PUBLIC_SUPABASE_URL,
18
- SUPABASE_ANON_KEY: process.env.SUPABASE_ANON_KEY ?? process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
19
- SUPABASE_SERVICE_ROLE_KEY: process.env.SUPABASE_SERVICE_ROLE_KEY,
19
+ // New Supabase key naming (publishable / secret) first, then the legacy anon / service_role names.
20
+ // NEXT_PUBLIC_* variants cover the Edge runtime (proxy), where only public vars are inlined.
21
+ SUPABASE_ANON_KEY: process.env.SUPABASE_PUBLISHABLE_KEY ??
22
+ process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY ??
23
+ process.env.SUPABASE_ANON_KEY ??
24
+ process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
25
+ SUPABASE_SERVICE_ROLE_KEY: process.env.SUPABASE_SECRET_KEY ?? process.env.SUPABASE_SERVICE_ROLE_KEY,
20
26
  });
21
27
  if (!parsed.success) {
22
28
  throw new Error(`[adapter-supabase] invalid env:\n${parsed.error.issues.map((i) => ` - ${i.path}: ${i.message}`).join('\n')}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deverjak/tenantkit-adapter-supabase",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Supabase reference adapter for @deverjak/tenantkit-kernel — Database, Identity, Session, Authz, Storage. Drop-in: createSupabaseRuntime() -> CoreRuntime.",
5
5
  "license": "MIT",
6
6
  "type": "module",