Skip to main content
1

Setting up Firebase

  1. First, in order to create authentication with Firebase you will need two things: first, a Firebase account and second, a React project.
Once you have your account you must:
  • Go to your console and create a new Firebase project.
  • Once you have a project, proceed to the Authentication section.
  • Click on the Sign in method tab and enable the Email/password sign-in method and click save.
  • Go to project settings, scroll and under your apps section click on the web app usually displayed with a </> icon.
  • Register your app and click save.
  1. Install the npm package in your project:
On the Firebase Register web app page, you will also be provided something like this. Save it for later.
2

Create a Firebase Config file

  1. Create a file named firebase.ts with the following configuration:
Note:
❗ React apps don’t have environment variable safety – use VITE_ prefix (for Vite) or .env.local for created local React app.
For more information about Vite environment variables, see the Vite documentation.
and for more on Create React App’s environment variables, see the React environment variables docs.
  1. Update your environment variables:
From the firebaseConfig JSON object provided by Firebase when initializing your project, set up your environment variables.
3

Install the Chipi SDK

Install the required packages:
4

Setup the Chipi SDK Provider

  1. In your .env file, add your Chipi publishable API key:
Never put a Chipi secret key in a Vite/React client app. Any environment variable prefixed with VITE_ is bundled into the browser JavaScript and exposed via import.meta.env, which means anyone inspecting your shipped app can read it. The @chipi-stack/chipi-react SDK uses only apiPublicKey — the type ChipiBrowserSDKConfig explicitly sets apiSecretKey?: never (see types/src/core.ts). Secret keys belong on your backend only.
  1. Set up the Chipi Pay provider in your application:
5

Add Google's public keys endpoint to Chipi configuration🕺 !

Visit the dashboard JWKS and JWT configuration, select Firebase as your auth provider, and paste this under the JWKS Endpoint URL.
6

Follow the Firebase guides and begin your Journey !

Visit the Firebase Authentication guide to learn how to use createUserWithEmailAndPassword and create your sign up and login!
7

Using Firebase Auth with Chipi hooks 🕺 !

Below you will see a simple example of how you can get and pass your tokens to the different Chipi hooks:
Note: If you have not yet created a wallet, you may see an error with a message like:message:“Wallet not found for externalUserId: user_id, apiPublicKey: pk_prod_something”This error is expected and shows that your app is correctly contacting Chipi, but there is not yet a wallet for this user. Once you create a wallet, this error will disappear.
8

Celebrate & Learn More! 🎉

That’s it! You should now have an initial working version of Chipi Pay integrated into your application. You can now start implementing various features like:
  • Wallet Creations
  • Sending tokens
  • Signing transactions
  • and more!
Need help? Check out our Telegram Community for support and to connect with other developers.