Repository navigation
feat: rename anon key → publishable key, service role key → secret key - #1360
Merged
Merged
Conversation
…et key Renames all references to align with Supabase's updated key naming convention: - `anonKey` parameter → `publishableKey` in Supabase.initialize() and _init() - `supabaseAnonKey` → `supabasePublishableKey` (internal parameter) - `ANON_KEY` / `SUPABASE_ANON_KEY` → `PUBLISHABLE_KEY` / `SUPABASE_PUBLISHABLE_KEY` in examples, docs, and infra config - `service_role` key references in doc comments → `secret` key - Test variables `anonToken` → `publishableToken` in gotrue tests JWT role claims (`'role': 'service_role'`) are left unchanged as they are internal backend values unrelated to the key naming convention. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nv var rename - Keep anonKey as @deprecated in Supabase.initialize() so existing callers continue to compile; they receive a deprecation warning pointing to publishableKey. An assert enforces that at least one of the two is supplied. - Revert ANON_KEY → PUBLISHABLE_KEY in docker-compose: the storage binary reads ANON_KEY by name, renaming it silently breaks the service. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
The |
mandarini
approved these changes
Apr 27, 2026
The key passed to Supabase.initialize() can be either a publishable key (anon) or a secret key depending on the use case, so the parameter name should not imply a specific key type. Aligns with SupabaseClient which already uses supabaseKey as its positional argument. - Rename publishableKey parameter -> supabaseKey in Supabase.initialize() - Update deprecated anonKey message to reference supabaseKey - Update all call sites in tests, examples, docs, and CHANGELOG - Revert internal gotrue test variable names back to anonToken (they represent the anonymous JWT, unrelated to the public API rename) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…PABASE_PUBLISHABLE_KEY in example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
@Vinzent03 I decided to go with |
Vinzent03
requested changes
Apr 27, 2026
…ckage; revert CHANGELOG edits - Supabase.initialize() (supabase_flutter): rename supabaseKey → publishableKey. Flutter apps are client-side and should always use the publishable (anon) key, matching the label shown on the Supabase dashboard. - SupabaseClient (supabase): keep supabaseKey as-is. The dart package is used in both client and server contexts, so the generic name is appropriate. - Add a note to SupabaseClient doc distinguishing publishable vs secret usage. - Revert all CHANGELOG modifications — historical entries should not be refactored. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Vinzent03
approved these changes
Apr 27, 2026
This was referenced Apr 29, 2026
grdsdev
added a commit
to supabase/supabase
that referenced
this pull request
May 8, 2026
## Summary Updates reference docs based on recent **stable** releases across supabase-js, supabase-flutter, and supabase-py. Only changes that landed in a stable tag are documented. ## Changes analyzed | SDK | Repo | Stable tag range | Notes | |-----|------|-----------------|-------| | js | supabase/supabase-js | `v2.105.0` → `v2.105.3` | Bug fixes and type improvements; no doc-worthy API changes | | dart | supabase/supabase-flutter | → `supabase_flutter-v2.13.0` | `anonKey` deprecated → `publishableKey` | | py | supabase/supabase-py | `v2.29.0` → `v2.30.0` | New: `.select()` chaining on write builders | | swift | supabase/supabase-swift | `v2.46.0` | Dependency bumps only | | kt | supabase-community/supabase-kt | `3.6.0` | Test coverage improvements only | | csharp | supabase-community/supabase-csharp | `v1.1.2` | No changes | > **Note**: The JS `storage.from().exists()` breaking behavior change and `PostgrestError instanceof` fix were intentionally excluded — they are only in the `v3.0.0-next` pre-release branch, not in any stable `v2.x` tag. ## Documentation updates ### `apps/docs/spec/supabase_dart_v2.yml` - Rename `anonKey` parameter → `publishableKey` in `Supabase.initialize()` to match the deprecation in [supabase-flutter#1360](supabase/supabase-flutter#1360) (landed in `supabase_flutter-v2.13.0`) - Update Flutter example to use `publishableKey:` named argument - Note that `anonKey` is still accepted but deprecated ### `apps/docs/spec/supabase_py_v2.yml` - Add `.select()` chaining examples to `insert()`, `update()`, `upsert()`, and `delete()` write builders, newly supported in [supabase-py v2.30.0](supabase/supabase-py#1383) - Add notes to each write method mentioning select chaining capability --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Documentation** * Dart SDK: Updated client initialization to use `publishableKey` parameter; deprecated `anonKey` remains supported for backward compatibility. * Python SDK: Added examples demonstrating how to chain `.select()` with write operations (`insert()`, `update()`, `upsert()`, `delete()`) to retrieve specific columns from modified rows. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
syouya0618
added a commit
to syouya0618/irori
that referenced
this pull request
Jun 12, 2026
…nonKey→publishableKey へ rename (Closes #9 の代替) (#51) dependabot PR #9 (go_router 17.2.3→17.3.0 + supabase_flutter 2.12.4→2.14.2) の代替。#9 は supabase_flutter 2.13.0 で導入された anonKey deprecation (CHANGELOG: "FEAT: rename anon key → publishable key" supabase/supabase-flutter#1360) により lib/main.dart:32 の deprecated_member_use info で `flutter analyze --fatal-infos` が fail し、rebase では解消不能のため bump + rename を本 PR に統合する。 deprecation 一次情報 (pub cache supabase_flutter-2.14.2/lib/src/supabase.dart): @deprecated( 'Use publishableKey instead. anonKey will be removed in a future major version.', ) String? anonKey, 内部実装は `final effectiveKey = publishableKey ?? anonKey!;` で両パラメータが 合流するだけで値の形式検証はなく、legacy anon key (JWT) / sb_publishable_ キーのどちらも同一に受けるため、rename による挙動差分はない。 env 名 SUPABASE_ANON_KEY と --dart-define の渡し方は CI / Vercel 連動のため不変。 pubspec.lock の変動 (fvm flutter pub get 生成、すべて supabase ファミリー transitive + 直接 bump 2 件): - supabase_flutter 2.12.4 → 2.14.2 (direct) - go_router 17.2.3 → 17.3.0 (direct) - supabase 2.10.6 → 2.12.2 - gotrue 2.20.0 → 2.21.0 - functions_client 2.5.0 → 2.6.0 - postgrest 2.7.0 → 2.7.1 - realtime_client 2.7.3 → 2.7.4 - storage_client 2.5.2 → 2.5.6 ゲート: fvm flutter analyze --fatal-infos (No issues) / fvm flutter test (784 passed) / fvm dart format --set-exit-if-changed lib test (0 changed) 全 green。 Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates API key terminology across code, tests, docs, and infra. No breaking changes — the old
anonKeyparameter is deprecated with a migration message pointing to the new name.Changes
supabase_flutter—Supabase.initialize()anonKeyis deprecated in favour ofpublishableKey. Both are accepted;publishableKeytakes precedence if both are supplied.publishableKeyis the right name for the Flutter package: apps run on the client and should always use the publishable (anon) key. The doc comment now explicitly warns against using the secret key here.supabase—SupabaseClientThe positional
supabaseKeyparameter is kept as-is — the plain Dart package is used in both client and server contexts, so a generic name is appropriate. The doc comment is updated to clarify the distinction:Doc comments —
GoTrueAdminApi/GoTrueAdminOAuthApiReferences to
`service_role` keyupdated to`secret` keyto match the new naming.What was intentionally left unchanged
'role': 'service_role') — internal backend values, unrelated to key namingANON_KEYininfra/storage_client/docker-compose.yml— the storage binary reads this env var by name; renaming it would silently break the service🤖 Generated with Claude Code