Skip to content

Conversation

blakecduncan
Copy link
Collaborator

@blakecduncan blakecduncan commented Sep 26, 2025

Pull Request Checklist


PR-Codex overview

This PR introduces the @alchemy/react package, enhancing the Alchemy integration with React applications by providing a simplified configuration and a new AlchemyProvider.

Detailed summary

  • Added @alchemy/connectors-web as a dependency.
  • Introduced createAlchemyConfig function for simplified configuration.
  • Added AlchemyProvider component to wrap necessary providers.
  • Updated example usage to replace WagmiProvider with AlchemyProvider.
  • Enhanced documentation for createAlchemyConfig and AlchemyProvider.

The following files were skipped due to too many changes: yarn.lock

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Sep 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
aa-sdk-ui-demo Ready Ready Preview Comment Sep 26, 2025 9:12pm

Copy link

github-actions bot commented Sep 26, 2025

🌿 Documentation Preview

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Sep 26, 2025, 8:40 PM

@github-actions github-actions bot temporarily deployed to docs-preview September 26, 2025 20:38 Inactive
...(apiKey ? [alchemyAuth({ apiKey })] : []),
];

const wagmiConfig = createConfig({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I ended up not implementing the wagmiOverrides option in this PR. I wanted to get some opinions on it. I struggled getting the types to work for some reason, I kept getting a type error when doing a shallow copy into the params.

It got me thinking, I wonder if we should just try to expose options that we see fit (rather than a full wagmiOverrides option. And if anyone needs a bunch of wagmi overrides, we just recommend they build the wagmi config themselves.

@@ -77,6 +77,64 @@
resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.11.0.tgz#42cc67c5baa407ac25059fcd7d405cc5ecdb0c33"
integrity sha512-/3DDPKHqqIqxUULp8yP4zODUY1i+2xvVWsv8A79xGWdCAG+8sb0hRh0Rk2QyOJUnnbyPUAZYcpBuRe3nS2OIUg==

"@alchemy/aa-accounts@3.14.1":
Copy link
Contributor

Choose a reason for hiding this comment

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

do you need this many lockfile changes?

apiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY,
}),
],
export const config = createAlchemyConfig({
Copy link
Contributor

Choose a reason for hiding this comment

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

beautiful

export function AlchemyProvider({ config, children }: AlchemyProviderProps) {
return (
<WagmiProvider config={config.wagmi}>
{children as any}
Copy link
Contributor

Choose a reason for hiding this comment

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

curious why you have to cast to any here. i think i've maybe seen this before when there were conflicts w/ different library versions?

return perChain;
})();

// Note: Currently using alchemyAuth; swap to alchemySmartWallet when ready.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit so we can more easily find this.

Suggested change
// Note: Currently using alchemyAuth; swap to alchemySmartWallet when ready.
// TODO(v5): Currently using alchemyAuth; swap to alchemySmartWallet when ready.


const wagmiConfig = createConfig({
chains,
transports: transports!,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: does typing transports as NonNullable<CreateConfigParameters["transports"]> above avoid this non-null assertion?

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.

2 participants