needware-cli 1.6.9 → 1.6.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: supabase-integration
|
|
3
|
-
description: Complete Supabase integration for React applications including database setup, authentication, storage, and Edge Functions. Use this skill when users mention Supabase, databases, user authentication, file storage, "Enable Cloud", or backend functionality.
|
|
3
|
+
description: Complete Supabase integration for React applications including database setup, authentication, storage, and Edge Functions. Use this skill when users mention Supabase, databases, user authentication, file storage, "Enable Cloud", or backend functionality.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Supabase Integration
|
|
@@ -37,8 +37,6 @@ Check if Supabase is already integrated:
|
|
|
37
37
|
|
|
38
38
|
Complete guide for integrating Supabase into React applications with database, authentication, storage, and serverless functions.
|
|
39
39
|
|
|
40
|
-
Supabase 集成指南,包括数据库、认证、存储和 Edge Functions。
|
|
41
|
-
|
|
42
40
|
## Quick Start
|
|
43
41
|
|
|
44
42
|
### When to Use This Skill
|
|
@@ -51,7 +49,9 @@ Use this skill when working with:
|
|
|
51
49
|
- Real-time data subscriptions
|
|
52
50
|
- Row Level Security (RLS) policies
|
|
53
51
|
|
|
54
|
-
|
|
52
|
+
**Key Principles**:
|
|
53
|
+
1. Use Supabase as the default database and backend service unless explicitly specified otherwise by the user.
|
|
54
|
+
2. **Do not add user authentication unless explicitly requested by the user.** Only implement authentication features when the user specifically asks for login, signup, or user management functionality.
|
|
55
55
|
|
|
56
56
|
## Initial Setup
|
|
57
57
|
|
|
@@ -192,19 +192,19 @@ export const supabase = createClient(supabaseUrl, supabaseKey);
|
|
|
192
192
|
### Authentication Examples
|
|
193
193
|
|
|
194
194
|
```typescript
|
|
195
|
-
//
|
|
195
|
+
// Sign up
|
|
196
196
|
const { data, error } = await supabase.auth.signUp({
|
|
197
197
|
email: 'user@example.com',
|
|
198
198
|
password: 'securepassword'
|
|
199
199
|
});
|
|
200
200
|
|
|
201
|
-
//
|
|
201
|
+
// Sign in
|
|
202
202
|
const { data, error } = await supabase.auth.signInWithPassword({
|
|
203
203
|
email: 'user@example.com',
|
|
204
204
|
password: 'securepassword'
|
|
205
205
|
});
|
|
206
206
|
|
|
207
|
-
//
|
|
207
|
+
// Sign out
|
|
208
208
|
const { error } = await supabase.auth.signOut();
|
|
209
209
|
```
|
|
210
210
|
|
|
@@ -226,7 +226,7 @@ CREATE TABLE IF NOT EXISTS profiles (
|
|
|
226
226
|
|
|
227
227
|
ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;
|
|
228
228
|
|
|
229
|
-
--
|
|
229
|
+
-- Add policies
|
|
230
230
|
CREATE POLICY "Users can view all profiles"
|
|
231
231
|
ON profiles
|
|
232
232
|
FOR SELECT
|