Skip to content

Cloud Functions

Mindhyv calls 14 Firebase Cloud Functions (13 custom + 1 Stripe extension). All custom functions use httpsCallable from Firebase.

import { httpsCallable } from 'firebase/functions';
const fn = httpsCallable(functions, 'functionName');
const result = await fn(params);

Creates a Stripe product and optional price on a seller’s Connect account.

ParameterTypeDescription
hubIdstringHub ID
portfolioItemIdstringService/product ID
namestringProduct name
descriptionstringProduct description
priceobject{ amount, currency, type }
accountIdstringStripe Connect account ID
metadataobjectCustom metadata (e.g., type: 'service')

Returns: { success, productId, priceId?, message? }

Called from: Service dialog, product dialog (hub content editors)

Updates an existing Stripe product’s name, description, active status, or image.

Called from: Hub content editors (when editing service/product details)

Deletes or archives a Stripe product. Falls back to archiving if delete fails.

Creates a new Stripe price for an existing product. Supports one_time and recurring types.

Updates or creates Stripe prices. Handles package pricing changes for services.

Called from: Service editor, service packages editor, product pricing editor, product variants editor

Creates a new Stripe Express Connect account for a seller.

ParameterTypeDescription
userIdstringFirebase user ID
emailstringUser email
displayNamestringUser display name
countrystringCountry code (US or MX)

Returns: { success, accountLink?, message? }

Called from: Hub payments settings page

Retrieves current Stripe Connect account status and requirements.

ParameterTypeDescription
accountIdstringStripe Connect account ID

Returns: { success, chargesEnabled, payoutsEnabled, status, requirements, alldata }

Called from: Hub payments settings page (on load)

Generates an onboarding/continuation link for Stripe Connect setup.

ParameterTypeDescription
accountIdstringStripe Connect account ID
hubIdstringHub ID
returnUrlstringReturn URL after setup

Returns: { success, accountLink?, message? }

Called from: Hub payments settings page

Generates a Stripe Express dashboard login link.

ParameterTypeDescription
accountIdstringStripe Connect account ID
redirectUrlstringRedirect URL (optional)

Returns: { success, url }

Called from: Nav user menu (Stripe dashboard link)

Creates a Stripe checkout session for marketplace purchases using Direct Charges.

ParameterTypeDescription
priceIdstringStripe price ID
sellerStripeAccountIdstringSeller’s Connect account
amountInCentsnumberPurchase amount
successUrlstringSuccess redirect URL
cancelUrlstringCancel redirect URL
currencystringCurrency code
buyerIdstringBuyer’s user ID
platformFeePercentagenumberPlatform fee (0.05 = 5%)
metadataobjectOrder details (serviceId, hubId, packageId, etc.)

Returns: { sessionId, url, orderId, applicationFeeAmount }

Called from: Order summary component (marketplace checkout flow)

Syncs service/product details with Stripe, creating product and price records as needed.

ParameterTypeDescription
hubIdstringHub ID
serviceIdstringService ID
accountIdstringStripe Connect account ID
serviceobjectService details
packagesarrayService packages with pricing

Returns: { success, productId, createdProduct, basePriceId, packagePrices[], message }

Called from: Service editor, product editor (sync to Stripe button)

Retrieves full user profile data by username (used for public profiles).

ParameterTypeDescription
userNamestringUsername to look up

Returns: { success, userId, userData, testimonials, skills, workExperiences, educations, certifications, projects, socialLinks, ctas }

Called from: Public profile page (/public-profile/[id])

Tracks new user signups via referral codes.

ParameterTypeDescription
referralCodestringReferral code used
userAgentstringBrowser user agent
ipAddressstringUser IP
utm_*stringUTM parameters (source, medium, campaign, term, content)
userDataobject{ email, displayName }

Returns: { success, referralId?, message? }

Called from: Referral service (trackReferralSignup() on sign-up)

Section titled “ext-firestore-stripe-payments-createPortalLink”

Provided by the Stripe Firestore extension. Creates a Stripe Customer Portal link for subscription management.

ParameterTypeDescription
returnUrlstringReturn URL after portal
localestringPortal locale

Returns: { url }

Called from: Nav user menu, account subscription section

CategoryCountFunctions
Stripe Products5create, update, delete, createPrice, updatePrice
Stripe Connect4createAccount, getStatus, getLink, getLoginLink
Marketplace1createConnectCheckout
Sync1syncStripeService
Profile1getUserDataByUsername
Referrals1trackReferralSignup
Extension1createPortalLink