title: Cloud Functions for Firebase - write to database when a new user created
body: <p>I am pretty new Cloud Functions for Firebase and the javascript language. I am trying to add a function every time a user created to write into the database. This is my code:</p>
  
  <pre><code>const functions = require('firebase-functions');
  const admin = require('firebase-admin');
  
  admin.initializeApp(functions.config().firebase);
  
  exports.addAccount = functions.auth.user().onCreate(event =&gt; {
  const user = event.data; // The firebase user
  const id = user.uid;
  const displayName = user.displayName;
  const photoURL = user.photoURL;
  
  return admin.database().ref.child("/users/${id}/info/status").set("ok");} );
  </code></pre>
  
  <p>what I am trying to do is every time a user signup to my app, the functions wil write into the database that his status is "OK". But my code dosn't work.
  <a href="https://i.stack.imgur.com/YYeR7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/YYeR7.png" alt="enter image description here"></a></p>
  
  <p>what am I doing wrong?</p>