@contentgrowth/content-auth 0.4.8 → 0.5.0

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.
Files changed (31) hide show
  1. package/README.md +68 -2
  2. package/dist/backend/index.d.ts +185 -1903
  3. package/dist/backend/index.js +1 -1
  4. package/dist/{chunk-CTASTCWI.js → chunk-3HNFZJ7S.js} +6 -6
  5. package/dist/{chunk-WI4UHTAT.js → chunk-52ZT54FA.js} +71 -186
  6. package/dist/chunk-CBNSTIX6.js +17 -0
  7. package/dist/chunk-F2G7XJIZ.js +17 -0
  8. package/dist/frontend/astro.d.ts +6 -0
  9. package/dist/frontend/astro.js +9 -0
  10. package/dist/frontend/client.d.ts +54 -18
  11. package/dist/frontend/clients/astro-client.d.ts +3134 -0
  12. package/dist/frontend/clients/astro-client.js +9 -0
  13. package/dist/frontend/clients/vue-client.d.ts +3520 -0
  14. package/dist/frontend/clients/vue-client.js +9 -0
  15. package/dist/frontend/components/astro/astro/AuthForm.astro +389 -0
  16. package/dist/frontend/components/astro/astro/ForgotPasswordForm.astro +127 -0
  17. package/dist/frontend/components/astro/astro/Organization.astro +254 -0
  18. package/dist/frontend/components/astro/astro/PasswordChanger.astro +128 -0
  19. package/dist/frontend/components/astro/astro/ProfileEditor.astro +133 -0
  20. package/dist/frontend/components/astro/astro/ResetPasswordForm.astro +172 -0
  21. package/dist/frontend/components/vue/vue/AuthForm.vue +337 -0
  22. package/dist/frontend/components/vue/vue/ForgotPasswordForm.vue +108 -0
  23. package/dist/frontend/components/vue/vue/Organization.vue +215 -0
  24. package/dist/frontend/components/vue/vue/PasswordChanger.vue +115 -0
  25. package/dist/frontend/components/vue/vue/ProfileEditor.vue +112 -0
  26. package/dist/frontend/components/vue/vue/ResetPasswordForm.vue +150 -0
  27. package/dist/frontend/index.js +1 -1
  28. package/dist/frontend/vue.d.ts +12 -0
  29. package/dist/frontend/vue.js +23 -0
  30. package/dist/index.js +2 -2
  31. package/package.json +32 -6
package/README.md CHANGED
@@ -153,8 +153,6 @@ export default function App() {
153
153
  You can also use the `authClient` directly for custom implementations:
154
154
 
155
155
  ```typescript
156
- import { authClient } from '@contentgrowth/content-auth/client';
157
-
158
156
  // Example: Sign in with email
159
157
  await authClient.signIn.email({
160
158
  email: "user@example.com",
@@ -162,6 +160,74 @@ await authClient.signIn.email({
162
160
  });
163
161
  ```
164
162
 
163
+ ### 3. Frontend Setup (Astro)
164
+
165
+ Import components directly in your Astro pages. They use standard HTML/JS and don't require any framework integrations.
166
+
167
+ ```astro
168
+ ---
169
+ import { AuthForm } from '@contentgrowth/content-auth/astro/components/AuthForm.astro';
170
+ import '@contentgrowth/content-auth/styles.css';
171
+ ---
172
+
173
+ <div class="min-h-screen flex items-center justify-center bg-gray-50">
174
+ <div class="max-w-md w-full">
175
+ <h1 class="text-2xl font-bold text-center mb-6">Welcome Back</h1>
176
+
177
+ <AuthForm
178
+ view="signin"
179
+ baseUrl="http://localhost:8787" <!-- Your backend URL -->
180
+ redirectUrl="/dashboard"
181
+ />
182
+ </div>
183
+ </div>
184
+ ```
185
+
186
+ **Client Usage (Vanilla JS):**
187
+
188
+ ```typescript
189
+ import { authClient } from '@contentgrowth/content-auth/astro/client';
190
+
191
+ await authClient.signIn.email({ ... });
192
+ ```
193
+
194
+ ### 4. Frontend Setup (Vue)
195
+
196
+ Import components in your Vue 3 application.
197
+
198
+ ```vue
199
+ <script setup>
200
+ import { AuthForm } from '@contentgrowth/content-auth/vue';
201
+ import '@contentgrowth/content-auth/styles.css';
202
+
203
+ const handleSuccess = (data) => {
204
+ console.log('User authenticated!', data);
205
+ window.location.href = '/dashboard';
206
+ };
207
+ </script>
208
+
209
+ <template>
210
+ <div class="min-h-screen flex items-center justify-center bg-gray-50">
211
+ <div class="max-w-md w-full">
212
+ <h1 class="text-2xl font-bold text-center mb-6">Welcome Back</h1>
213
+
214
+ <AuthForm
215
+ view="signin"
216
+ @success="handleSuccess"
217
+ />
218
+ </div>
219
+ </div>
220
+ </template>
221
+ ```
222
+
223
+ **Client Usage (Vue):**
224
+
225
+ ```typescript
226
+ import { authClient } from '@contentgrowth/content-auth/vue/client';
227
+
228
+ await authClient.signIn.email({ ... });
229
+ ```
230
+
165
231
  ## Database Setup
166
232
 
167
233
  This package requires specific database tables to function. We provide a **SQL schema template** that you copy into your project and extend with your own tables.