diff --git a/.gitignore b/.gitignore index 7afb4de7..272915c2 100644 --- a/.gitignore +++ b/.gitignore @@ -60,6 +60,7 @@ node_modules/ # dotenv environment variables file .env .env.test +.env.local # parcel-bundler cache (https://parceljs.org/) .parcel-cache diff --git a/examples/community/.env.example b/examples/community/.env.example new file mode 100644 index 00000000..67091728 --- /dev/null +++ b/examples/community/.env.example @@ -0,0 +1 @@ +PUBLIC_KEY="" diff --git a/examples/community/src/app.tsx b/examples/community/src/app.tsx index dd7f6f25..75beea91 100644 --- a/examples/community/src/app.tsx +++ b/examples/community/src/app.tsx @@ -2,6 +2,14 @@ import React from 'react' import { Community } from '@status-im/react' -export const App = () => { - return +const publicKey = process.env.PUBLIC_KEY + +if (!publicKey) { + throw new Error( + 'Add PUBLIC_KEY to your environment variables (see .env.example)' + ) +} + +export const App = () => { + return }