Projects & keys

Everything in Galacha lives under a project. You create one per app you want to record.

What a project owns

ThingPurpose
Project keyThe long hex token the SDK authenticates with
Project IDInternal UUID for dashboard routing (you never pass this anywhere)
Platformweb, react-native, flutter, swift, kotlin — picks the default snippet
Display nameShown in the dashboard sidebar
MembersTeam permissions (owner / admin / viewer)
CreditsHow many sessions you can still record

The project key

The only thing the SDK cares about. It's a 48-character hex string that looks like this:

4d4b83bcd00acd4cbc8ab5a7d94bab5abbc31887dbc1bf3f

Pass it to init():

// Web + React
<GalachaProvider projectKey="4d4b83bcd00a..." />
 
// React Native
Galacha.init({ projectKey: "4d4b83bcd00a..." });

The backend uses it to route events to the right project and check your credit balance.

Where to find it

  1. Sign in to galacha.me
  2. Click New Project (or open an existing one)
  3. Copy the project key from the project detail page

Never commit the key inline. Use environment variables:

FrameworkVariable name
Next.jsNEXT_PUBLIC_GALACHA_PROJECT_KEY
ViteVITE_GALACHA_PROJECT_KEY
Create React AppREACT_APP_GALACHA_PROJECT_KEY
ExpoEXPO_PUBLIC_GALACHA_PROJECT_KEY

All browser-exposed env vars must carry the framework's public prefix or the build step strips them.

Can I use the same key in dev and prod?

Yes, but you'll mix sessions. Cleaner: create two projects (myapp-dev + myapp-prod) and pass the key via env var. The dashboard filters are per-project, so the dev noise stays out of your prod dashboard.

What if the key leaks?

The project key is write-only. It can only POST events to api.galacha.me/api/v1/events. It cannot read sessions, access the dashboard, delete data, or modify billing. Worst case: someone spams events into your project, burning credits.

If it happens, rotate the key from the dashboard. The old key stops accepting new events immediately. Any sessions already recorded keep working.

Related