Skip to content

refactor: Update Web3Auth instance to allow null value#142

Merged
Adebesin-Cell merged 1 commit into
mainfrom
fix/improvements
Feb 3, 2026
Merged

refactor: Update Web3Auth instance to allow null value#142
Adebesin-Cell merged 1 commit into
mainfrom
fix/improvements

Conversation

@Adebesin-Cell
Copy link
Copy Markdown
Member

@Adebesin-Cell Adebesin-Cell commented Feb 3, 2026

Related #140

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 3, 2026

⚠️ No Changeset found

Latest commit: 83f2043

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Adebesin-Cell Adebesin-Cell merged commit d13e14f into main Feb 3, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @Adebesin-Cell, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the Web3Auth integration to enhance its compatibility with server-side rendering (SSR) environments. By allowing the Web3Auth instance to be null when the browser's window object is unavailable, the application can gracefully handle rendering without client-side specific dependencies. This change involves updating type definitions, implementing conditional instance initialization, and adding null checks where the instance is consumed, thereby improving the overall robustness of the authentication flow. Additionally, the documentation has been expanded to include updated Tailwind CSS integration guidelines.

Highlights

  • Web3Auth Instance Nullability: The web3AuthInstance property in IqLoginConfig and Web3AuthProvider now explicitly allows a null value, enabling more flexible handling of the Web3Auth instance.
  • Server-Side Rendering (SSR) Compatibility: The web3AuthInstance is now conditionally initialized to null during server-side rendering (when window is undefined), preventing errors in non-browser environments. Related connectors also check for the instance's existence.
  • Robustness in Web3AuthProvider: A null check has been added within the useEffect hook of Web3AuthProvider to ensure that event listeners are only attached if a web3AuthInstance is present, preventing runtime errors.
  • Documentation Update: The README.md has been updated with new instructions for integrating the package with both Tailwind CSS v3 and v4, including a specific @source directive for v4.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • README.md
    • Added new documentation section for Tailwind CSS v3 integration.
    • Added new documentation section for Tailwind CSS v4 integration, including the @source directive.
  • src/config/iq-login.config.ts
    • Modified IqLoginConfig interface to allow web3AuthInstance to be of type Web3AuthModal.Web3Auth | null.
    • Updated createIqLoginConfig function to conditionally initialize web3AuthInstance to null if typeof window is undefined.
    • Modified the initialization of connectors to check for the existence of web3AuthInstance.
  • src/hooks/use-web-3-auth.tsx
    • Updated the web3AuthInstance prop type in Web3AuthProvider to Web3Auth | null.
    • Added a null check (if (!web3AuthInstance) { return; }) at the beginning of the useEffect hook to prevent errors when web3AuthInstance is null.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Adebesin-Cell Adebesin-Cell deleted the fix/improvements branch February 3, 2026 16:23
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Web3Auth instance handling to properly support server-side rendering (SSR) by allowing the web3AuthInstance to be null when the window object is not available. This is a crucial improvement for applications that need to run in SSR environments, preventing potential errors and ensuring a smoother experience. The changes are consistently applied across the IqLoginConfig interface, the createIqLoginConfig function, and the Web3AuthProvider component, including necessary null checks. Additionally, the README.md has been updated with instructions for Tailwind CSS v4, which is a helpful documentation enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant