diff --git a/README.md b/README.md index f3b4ebd..cf607e4 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ yarn create next-app account-kit-app -e https://github.com/avarobinson/account-k ### Get you alchemy api key - Create a new embedded accounts configuration for an alchemy app in your [dashboard](https://dashboard.alchemy.com/accounts) -- Replace the api key in the config.ts file +- Copy sample.env.local to .env.local +- Replace the environment variable with your new Account Kit config's API key ### Run the app diff --git a/config.ts b/config.ts index a132ffb..25b26ff 100644 --- a/config.ts +++ b/config.ts @@ -29,7 +29,7 @@ const uiConfig: AlchemyAccountsUIConfig = { export const config = createConfig( { - transport: alchemy({ apiKey: "ALCHEMY_API_KEY" }), // TODO: add your Alchemy API key - https://dashboard.alchemy.com/accounts + transport: alchemy({ apiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY }), // TODO: add your Alchemy API key to .env.local - https://dashboard.alchemy.com/accounts chain: sepolia, ssr: true, // more about ssr: https://accountkit.alchemy.com/react/ssr storage: cookieStorage, // more about persisting state with cookies: https://accountkit.alchemy.com/react/ssr#persisting-the-account-state diff --git a/sample.env.local b/sample.env.local new file mode 100644 index 0000000..27fbdfd --- /dev/null +++ b/sample.env.local @@ -0,0 +1 @@ +NEXT_PUBLIC_ALCHEMY_API_KEY="ALCHEMY_API_KEY"