### Installing Svelte Firekit Dependencies - Bash Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md This command installs the necessary packages for Svelte Firekit and the core Firebase library using npm. ```bash npm install firebase svelte-firekit ``` -------------------------------- ### Signing In With Google - TypeScript Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md This TypeScript snippet calls the `signInWithGoogle` method on the `firekitAuth` singleton to initiate the Google authentication flow. ```typescript await firekitAuth.signInWithGoogle(); ``` -------------------------------- ### Importing Svelte Firekit Authentication Singleton - TypeScript Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md This line shows how to import the main authentication singleton, `firekitAuth`, from the svelte-firekit library to access authentication methods. ```typescript import { firekitAuth } from 'svelte-firekit'; ``` -------------------------------- ### Performing Email/Password Authentication - TypeScript Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md This snippet demonstrates common email/password authentication operations: signing in with existing credentials, registering a new user, and signing out the current user. ```typescript // Sign in await firekitAuth.signInWithEmail(email, password); // Register await firekitAuth.registerWithEmail(email, password, displayName); // Sign out await firekitAuth.logOut(); ``` -------------------------------- ### Configuring Firebase Environment Variables - ENV Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md Define these environment variables in a `.env` file at your project root to configure the Firebase SDK. Svelte Firekit automatically reads these values. ```env PUBLIC_FIREBASE_API_KEY=your_api_key PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain PUBLIC_FIREBASE_PROJECT_ID=your_project_id PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id PUBLIC_FIREBASE_APP_ID=your_app_id PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id ``` -------------------------------- ### Displaying Current User Name in Svelte Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md This Svelte component snippet demonstrates how to import the `firekitUser` store and display the current user's display name reactivity. ```svelte Hello {firekitUser.displayName} ``` -------------------------------- ### Managing User Passwords - TypeScript Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md These methods provide functionality for handling user passwords, including sending a password reset email to the registered email address and updating the current user's password (which typically requires reauthentication first). ```typescript // Send password reset email await firekitAuth.sendPasswordReset(email); // Update password (requires reauthentication) await firekitAuth.updateUserPassword(newPassword, currentPassword); ``` -------------------------------- ### Authentication Operation Response Structure - TypeScript Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md This type definition shows the typical structure of the response object returned by authentication methods, indicating success or failure and providing a message and optional error code. ```typescript { success: boolean; message: string; code?: string; // In case of errors } ``` -------------------------------- ### Sending Email Verification - TypeScript Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md This method sends an email containing a verification link to the authenticated user's registered email address. ```typescript // Send verification email await firekitAuth.sendEmailVerificationToUser(); ``` -------------------------------- ### Updating User Profile Information - TypeScript Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md This snippet shows how to update specific fields of the authenticated user's profile, such as their display name or photo URL, by passing an object to the `updateUserProfile` method. ```typescript // Update user profile await firekitAuth.updateUserProfile({ displayName: "New Name", photoURL: "https://example.com/photo.jpg" }); ``` -------------------------------- ### Deleting User Account - TypeScript Source: https://github.com/code-gio/svelte-firekit/blob/main/README.md This method deletes the currently authenticated user's account, including both their Firebase Authentication record and the associated Firestore user document. ```typescript // Delete user account await firekitAuth.deleteUserAccount(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.