Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

create custom objects for user in firebase

everytime user is signing up, create a firestore doc about that user 

async function signUp(email, password) {
  // This function returns a credential which gives you the user's uid
  // which you could then use to create your document
  const credential = await createUserWithEmailAndPassword(auth, email, password);

  const uid = credential.user.uid

  // Create a new document using the uid as the document id
  // or however else you want to use this
  const ref = firebase.auth().collection("users").doc(uid)
  await ref.set({
    email,
    uid
  })
}

CODE BY "I'm Joe Too" from StackOverflow https://stackoverflow.com/questions/69547341/creating-a-document-every-time-someone-signs-up-in-firebase
Comment

PREVIOUS NEXT
Code Example
Typescript :: primeng dropdown formControlName setValue 
Typescript :: typescript api request header 
Typescript :: how can i take multiple inputs from the user in discord.js 
Typescript :: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16. 
Typescript :: typescript recursive types 
Typescript :: common mistakes in testing 
Typescript :: how to add 2 bind events on one button tkinteer 
Typescript :: access single document with its id flutter 
Typescript :: typescript how to create an array instance 
Typescript :: react typescript cheat sheet 
Typescript :: typescript extend imported namespace 
Typescript :: property decorator typescript constructor 
Typescript :: google chrome keyboard shortcuts windows 
Typescript :: mailto multiple recipients to cc 
Typescript :: mixpanel for typescript 
Typescript :: create npm module typescript 
Typescript :: c# compare two objects for changes 
Typescript :: web.contents timeout 
Typescript :: react onclick action starts automatically 
Typescript :: squash commits on branch 
Typescript :: typescript catch error type 
Typescript :: ng idle issue ERROR in node_modules/@ng-idle/core/lib/eventtargetinterruptsource.d.ts(29,9): error TS1086: An accessor cannot be declared in an ambient context. 
Typescript :: how to make objects move in roblox studio with a loop 
Typescript :: difference between facets and filters algolia 
Typescript :: None of the following functions can be called with the arguments supplied. makeText(Context!, CharSequence!, Int) defined in android.widget.Toast makeText(Context!, Int, Int) defined in android.widget.Toast 
Typescript :: python append elements from one list to anoter 
Typescript :: cubic beziere curve function 
Typescript :: material dialog disable close 
Typescript :: date formats in mongodb 
Typescript :: serenity.is cell text selectable 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =