hylekit 1.0.1 β 1.0.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/README.md +36 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,15 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
Distributed BetterAuth library for SvelteKit and Next.js with Google OAuth and Turso cloud database.
|
|
4
4
|
|
|
5
|
+
> **Note:** HyleKit provides **only the authentication database**. You will need to provision your own separate database for storing application data.
|
|
6
|
+
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
9
|
- π **Google OAuth** - Simple Google login integration
|
|
8
|
-
- π **Distributed Auth** - Each app runs auth locally, sharing a Turso
|
|
10
|
+
- π **Distributed Auth** - Each app runs auth locally, sharing a centralized Turso auth database
|
|
9
11
|
- π¦ **Framework Adapters** - First-class support for SvelteKit and Next.js
|
|
10
|
-
- ποΈ **Turso/LibSQL** - Edge-friendly SQLite database
|
|
12
|
+
- ποΈ **Turso/LibSQL** - Edge-friendly SQLite database for auth
|
|
11
13
|
- π **Session Management** - Automatic session handling with cookies
|
|
12
14
|
- π **BFF Pattern** - Built-in support for Backend-For-Frontend architecture with Express
|
|
13
15
|
|
|
16
|
+
## Database Architecture
|
|
17
|
+
|
|
18
|
+
HyleKit uses a **centralized authentication database** that all your applications connect to. This database stores:
|
|
19
|
+
- User accounts
|
|
20
|
+
- Sessions
|
|
21
|
+
- OAuth tokens
|
|
22
|
+
- Verification tokens
|
|
23
|
+
|
|
24
|
+
**You must provision two databases:**
|
|
25
|
+
|
|
26
|
+
| Database | Purpose | Provided by |
|
|
27
|
+
|----------|---------|-------------|
|
|
28
|
+
| **Hyle Auth Database** | Stores users, sessions, and auth data | HyleKit (shared Turso instance) |
|
|
29
|
+
| **Your Application Database** | Stores your app's business data | You (separate database) |
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
33
|
+
β Your Application β
|
|
34
|
+
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ€
|
|
35
|
+
β Hyle Auth Database β Your Application Database β
|
|
36
|
+
β (Turso - provided by Hyle) β (Postgres, MySQL, SQLite, etc.) β
|
|
37
|
+
β βββ users β βββ products β
|
|
38
|
+
β βββ sessions β βββ orders β
|
|
39
|
+
β βββ accounts β βββ posts β
|
|
40
|
+
β βββ verification β βββ ... your data β
|
|
41
|
+
ββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> **Important:** Your application database can use any database technology you prefer. HyleKit does not manage or interact with your application dataβonly authentication.
|
|
45
|
+
|
|
14
46
|
## Installation
|
|
15
47
|
|
|
16
48
|
```bash
|
|
@@ -21,8 +53,8 @@ npm install hylekit
|
|
|
21
53
|
|
|
22
54
|
```bash
|
|
23
55
|
# Turso Database
|
|
24
|
-
|
|
25
|
-
|
|
56
|
+
HYLE_DATABASE_URL=libsql://[db-name]-[org].turso.io
|
|
57
|
+
HYLE_DATABASE_AUTH_TOKEN=your-turso-token
|
|
26
58
|
|
|
27
59
|
# Google OAuth
|
|
28
60
|
GOOGLE_CLIENT_ID=your-google-client-id
|