Skip to content

[P1] Investigate Firestore SDK for event updates #25

Closed

Description

@KalebCole

Priority: P1 (High)

Investigate using Firebase Firestore SDK directly to update events, since Partiful has no REST API for updates.

Background

Partiful uses Firestore as their database. The web app writes event changes directly to Firestore rather than through REST endpoints. We already have Firebase auth working (refresh token → access token), so we may be able to use the Firestore SDK to update events.

Technical Approach

const { initializeApp } = require("firebase/app");
const { getFirestore, doc, updateDoc } = require("firebase/firestore");

const firebaseConfig = {
  apiKey: "AIzaSyCky6PJ7cHRdBKk5X7gjuWERWaKWBHr4_k",
  projectId: "getpartiful",
  authDomain: "getpartiful.firebaseapp.com"
};

const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

// Update event
await updateDoc(doc(db, "events", eventId), { title: "New Title" });

Investigation Steps

  1. Extract Firestore config from Partiful web app
  2. Determine collection path (likely events/{eventId})
  3. Verify our auth token works with Firestore SDK
  4. Test read operation first (safer than write)
  5. Inspect document structure to understand field names
  6. Test write on a throwaway test event
  7. Implement partiful update command if successful

Potential Issues

  • Security rules may block writes from non-web clients
  • Cloud Function triggers might fire on Firestore writes (could send notifications, etc.)
  • Field validation - Firestore may reject malformed documents
  • Race conditions if web app and CLI write simultaneously

Dependencies

  • firebase npm package (~1MB)
  • Existing auth flow (refresh token → access token)

Success Criteria

  • Can read event documents via Firestore SDK
  • Can update title, date, location, description via CLI
  • No unintended side effects (spurious notifications, etc.)

References

Activity

  1. KalebCole commented on Mar 8, 2026

    @KalebCole
    OwnerAuthor

    ✅ Implemented! Firestore REST API works perfectly.

    Usage:

    partiful update <eventId> --title "New Title"
    partiful update <eventId> --location "New Place" --capacity 20

    Supported fields: title, location, description, date, end-date, capacity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions