@insforge/sdk 1.2.1-dev.2 → 1.2.3

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 CHANGED
@@ -47,7 +47,7 @@ const { data, error } = await insforge.auth.signUp({
47
47
  email: 'user@example.com',
48
48
  password: 'securePassword123',
49
49
  name: 'John Doe', // optional
50
- redirectTo: 'http://localhost:3000/verify-email' // optional, for link-based verification
50
+ redirectTo: 'http://localhost:3000/sign-in' // optional, recommended for link-based verification
51
51
  });
52
52
 
53
53
  // Sign in with email/password
@@ -62,8 +62,8 @@ await insforge.auth.signInWithOAuth({
62
62
  redirectTo: 'http://localhost:3000/dashboard'
63
63
  });
64
64
 
65
- // Get current user
66
- const { data: user } = await insforge.auth.getCurrentUser();
65
+ // Get current user (call this during browser app startup)
66
+ const { data: currentUser } = await insforge.auth.getCurrentUser();
67
67
 
68
68
  // Get any user's profile by ID (public endpoint)
69
69
  const { data: profile, error } = await insforge.auth.getProfile('user-id-here');
@@ -85,7 +85,7 @@ await insforge.auth.signOut();
85
85
  // Resend a verification email
86
86
  await insforge.auth.resendVerificationEmail({
87
87
  email: 'user@example.com',
88
- redirectTo: 'http://localhost:3000/verify-email' // optional, for link-based verification
88
+ redirectTo: 'http://localhost:3000/sign-in' // optional, recommended for link-based verification
89
89
  });
90
90
 
91
91
  // Verify email with a 6-digit code
@@ -97,7 +97,7 @@ await insforge.auth.verifyEmail({
97
97
  // Send password reset email
98
98
  await insforge.auth.sendResetPasswordEmail({
99
99
  email: 'user@example.com',
100
- redirectTo: 'http://localhost:3000/reset-password' // optional, for link-based reset
100
+ redirectTo: 'http://localhost:3000/reset-password' // optional, recommended for link-based reset
101
101
  });
102
102
 
103
103
  // Code-based reset flow: exchange the code, then reset the password
@@ -120,6 +120,10 @@ For link-based verification and password reset, users click the emailed browser
120
120
 
121
121
  Those backend endpoints validate the token first, then redirect the browser to your `redirectTo` URL.
122
122
 
123
+ - Verification links redirect with `insforge_status=success|error`, `insforge_type=verify_email`, and optional `insforge_error`
124
+ - Recommended: use your sign-in page as the verification `redirectTo`, then show a confirmation message and ask the user to sign in with email and password
125
+ - Reset links redirect with `token` when ready, plus `insforge_status=ready|error`, `insforge_type=reset_password`, and optional `insforge_error`
126
+
123
127
  ### Database Operations
124
128
 
125
129
  ```javascript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/sdk",
3
- "version": "1.2.1-dev.2",
3
+ "version": "1.2.3",
4
4
  "description": "Official JavaScript/TypeScript client for InsForge Backend-as-a-Service platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -22,7 +22,8 @@
22
22
  "dev": "tsup --watch",
23
23
  "dev:tsc": "tsc --watch",
24
24
  "test": "vitest",
25
- "test:integration": "node integration-tests/run-all.js",
25
+ "test:integration": "vitest run --config vitest.integration.config.ts",
26
+ "test:integration:ci": "vitest run --config vitest.integration.config.ts --reporter=verbose",
26
27
  "test:run": "vitest run",
27
28
  "lint": "eslint src --ext .ts",
28
29
  "typecheck": "tsc --noEmit",
@@ -49,7 +50,7 @@
49
50
  "url": "https://github.com/InsForge/insforge-sdk-js/issues"
50
51
  },
51
52
  "dependencies": {
52
- "@insforge/shared-schemas": "^1.1.45-dev.1",
53
+ "@insforge/shared-schemas": "^1.1.46",
53
54
  "@supabase/postgrest-js": "^1.21.3",
54
55
  "socket.io-client": "^4.8.1"
55
56
  },
@@ -57,6 +58,7 @@
57
58
  "@types/node": "^20.11.24",
58
59
  "@typescript-eslint/eslint-plugin": "^7.1.0",
59
60
  "@typescript-eslint/parser": "^7.1.0",
61
+ "@vitest/coverage-v8": "^1.3.1",
60
62
  "eslint": "^8.57.0",
61
63
  "tsup": "^8.0.2",
62
64
  "typescript": "^5.3.3",