title: How to get and set data to Firebase with Node.js?
body: <p>I'm learning the Firebase and Node.js. I want to get my Tweets from Twitter and send them to Firebase. I can retrieve my tweets from Twitter, but couldn't send these tweets to Firebase.</p>
  <p>How can I send these tweets retrieved from Twitter to Firebase?</p>
  <p>I've tried the following code:</p>
  <pre><code>var firebase = require('firebase');
  
  // Initialize
  var app = firebase.initializeApp({
      ServiceAccount: {
         projectId: &quot;******&quot;,
         clientEmail: &quot;****@gmail.com&quot;,
         privateKey: &quot;-----BEGIN PRIVATE KEY-----\nkey\n-----END PRIVATE KEY-----\n&quot;
      },
     databaseURL: &quot;****.firebaseio.com&quot;
  }); 
  
  // Set Sample Data
  firebase.database().ref('/').set({
      username: &quot;test&quot;,
      email: &quot;test@mail.com&quot;
  });
  </code></pre>
  <p>And I got the following error on console:</p>
  <pre><code> Debugger listening on port 5858
   crypto.js:279
    var ret = this._handle.sign(toBuf(key), null, passphrase);
                           ^
  
  Error: error:0906D064:PEM routines:PEM_read_bio:bad base64 decode
      at Error (native)
      at Sign.sign (crypto.js:279:26)
      at Object.sign (C:\Users\admin\Desktop\myProject\myProject\node_modules\firebase\node_modules\jsonwebtoken\node_modules\jws\node_modules\jwa\index.js:54:45)
      at Object.jwsSign [as sign] (C:\Users\admin\Desktop\myProject\myProject\node_modules\firebase\node_modules\jsonwebtoken\node_modules\jws\lib\sign-stream.js:23:24)
      at Object.JWT.sign (C:\Users\admin\Desktop\myProject\myProject\node_modules\firebase\node_modules\jsonwebtoken\index.js:137:16)
      at authJwt (C:\Users\admin\Desktop\myProject\myProject\node_modules\firebase\auth-node\auth.js:83:16)
      at fetchAccessToken (C:\Users\admin\Desktop\myProject\myProject\node_modules\firebase\auth-node\auth.js:96:17)
      at app_.INTERNAL.getToken (C:\Users\admin\Desktop\myProject\myProject\node_modules\firebase\auth-node\auth.js:196:14)
      at Zb.getToken (C:\Users\admin\Desktop\myProject\myProject\node_modules\firebase\database-node.js:28:3496)
      at yh (C:\Users\admin\Desktop\myProject\myProject\node_modules\firebase\database-node.js:195:334)
   Press any key to continue...
  </code></pre>
  <p>Also, this my Firebase rules, I'm using these rules just for test purpose:</p>
  <pre><code>{
     &quot;rules&quot;:
     {  
        &quot;.read&quot;: true,
        &quot;.write&quot;: true
     }
  }
  </code></pre>