Skip to content
This repository was archived by the owner on May 13, 2023. It is now read-only.

Commit b00f894

Browse files
authored
Merge pull request #154 from supabase-community/chore/readme
chore: Update readme to direct Flutter developers to use supabase-flutter
2 parents 32ae3c8 + 02dc730 commit b00f894

File tree

1 file changed

+7
-55
lines changed

1 file changed

+7
-55
lines changed

README.md

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
A Dart client for [Supabase](https://supabase.io/).
44

5+
> **Note**
6+
>
7+
> If you are developing a Flutter application, use [supabase_flutter](https://pub.dev/packages/supabase_flutter) instead. `supabase` package is for non-Flutter Dart environments.
8+
59
[![pub package](https://img.shields.io/pub/v/supabase.svg)](https://pub.dev/packages/supabase)
610
[![pub test](https://github.com/supabase/supabase-dart/workflows/Test/badge.svg)](https://github.com/supabase/supabase-dart/actions?query=workflow%3ATest)
711

@@ -26,7 +30,7 @@ A Dart client for [Supabase](https://supabase.io/).
2630

2731
## Docs
2832

29-
`supabase-dart` mirrors the design of `supabase-js`. Find the documentation [here](https://supabase.io/docs/reference/javascript/initializing).
33+
Find the documentation [here](https://supabase.com/docs/reference/dart/initializing).
3034

3135
## Usage example
3236

@@ -93,6 +97,8 @@ main() {
9397

9498
### [Authentication](https://supabase.io/docs/guides/auth)
9599

100+
This package does not persist auth state automatically. Use [supabase_flutter](https://pub.dev/packages/supabase_flutter) for Flutter apps to persist auth state instead of this package.
101+
96102
```dart
97103
import 'package:supabase/supabase.dart';
98104
@@ -124,62 +130,8 @@ main() {
124130
}
125131
```
126132

127-
## Authentication
128-
129-
Initialize a [`SupabaseClient`](https://supabase.com/docs/reference/dart/initializing#access-supabaseclient-instance) by passing your **Supabase URL** and **Supabase KEY**. The keys can be found in your supabase project in `/setting/API`.
130-
131-
```dart
132-
final client = SupabaseClient('supabaseUrl', 'supabaseKey');
133-
```
134-
135-
The `client` has a [`auth`](https://pub.dev/documentation/supabase/latest/supabase/SupabaseClient/auth.html) attribute (of type [`GoTrueClient`](https://pub.dev/documentation/gotrue/latest/gotrue/GoTrueClient-class.html)) that you can use to authenticate your users using supabase.
136-
137-
### Sign up
138-
139-
Use the [`signUp`](https://supabase.com/docs/reference/dart/auth-signup) method to create a new user account.
140-
141-
```dart
142-
// Sign up user with email and password
143-
final response = await supabase.auth.signUp(email: email, password: password);
144-
final Session? session = response.session;
145-
final User? user = response.user;
146-
```
147-
148-
### Sign in
149-
150-
There are a few ways to sign in a user into your app.
151-
152-
Use the [`signInWithPassword`](https://supabase.com/docs/reference/dart/auth-signinwithpassword) method to sign in a user with their email or phone with password.
153-
154-
```dart
155-
// Sign in user with email and password
156-
final response = await client.auth.signInWithPassword(email: email, password: password);
157-
final Session? session = response.session;
158-
final User? user = response.user;
159-
```
160-
161-
Use the [`signInWithOtp`](https://supabase.com/docs/reference/dart/auth-signinwithotp) method to sign in a user using magic link with email or one time password using phone number.
162-
163-
```dart
164-
// Sign in user with email and password
165-
await client.auth.signInWithOtp(email: email);
166-
```
167-
168-
169-
### Sign out
170-
171-
Use the [`signOut`](https://supabase.com/docs/reference/dart/auth-signout) method to sign out a user.
172-
173-
```dart
174-
// Sign out user
175-
await client.auth.signOut();
176-
```
177-
178133
Check out the [**Official Documentation**](https://supabase.com/docs/reference/dart/) to learn all the other available methods.
179134

180-
## Guides
181-
182-
- Flutter Supabase Authentication - [Blog](https://www.sandromaglione.com/2021/04/24/flutter-supabase-authentication/)
183135

184136
## Contributing
185137

0 commit comments

Comments
 (0)