mirror of
https://github.com/supabase/supabase.git
synced 2026-06-04 03:41:38 +08:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated examples and guides to use Supabase publishable (client) keys instead of anon keys for client-side usage across frameworks and platforms. * Renamed environment variable examples and .env templates to reflect publishable key naming. * Adjusted sample requests and client-init examples to send/use the publishable key via the apikey header where applicable. * Updated references from service_role to secret for server-side credential guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: fadymak <fady@fadymak.com>
49 lines
1.6 KiB
Markdown
49 lines
1.6 KiB
Markdown
# Flutter Real-time Multiplayer Shooting Game
|
|
|
|
A real-time shooting game built with [Flutter](https://flutter.dev/), [Flame](https://flame-engine.org/) and [Supabase](https://supabase.com).
|
|
|
|
You can find a step by step guide on how to build this app on [How to build a real-time multiplayer game with Flutter Flame](https://supabase.com/blog/flutter-real-time-multiplayer-game) article.
|
|
|
|
## Getting Started
|
|
|
|
### 1. Create new project
|
|
|
|
Sign up to Supabase - [app.supabase.io](https://app.supabase.io) and create a new project. Wait for your database to start.
|
|
|
|
### 2. Get the URL and Key
|
|
|
|
Go to the Project Settings (the cog icon), open the API tab, and find your API URL and `anon` key, you'll need these in the next step.
|
|
|
|
Go to the Project Settings (the cog icon), open the API tab, and find your API URL and `publishable` key, you'll need these in the next step.
|
|
|
|
The `publishable` key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token.
|
|
|
|
### 3. Pull this example git repository
|
|
|
|
`git clone <<this repository url>> `
|
|
|
|
### 4. Paste the Supabase URL and Anon Key
|
|
|
|
Copy and paste the Supabase URL and Anon key in `lib/main.dart` file
|
|
|
|
```dart
|
|
void main() async {
|
|
await Supabase.initialize(
|
|
url: 'supabaseUrl',
|
|
anonKey: 'supabasePublishableKey',
|
|
realtimeClientOptions: const RealtimeClientOptions(eventsPerSecond: 40),
|
|
);
|
|
runApp(const MyApp());
|
|
}
|
|
```
|
|
|
|
### 5. Run the Flutter App
|
|
|
|
Now run
|
|
|
|
```bash
|
|
flutter run
|
|
```
|
|
|
|
This app can run on any environment that runs Flutter.
|