firebase-admin createCustomToken does not exist

203 views Asked by At

i'm trying to create a custom token for firebase in mi server

import * as admin from 'firebase-admin';

var serviceAccount = require('PATH_TO_CREDENTIALS');

console.log(serviceAccount);

admin.initializeApp({
    credential: admin.credential.cert(serviceAccount),
    databaseURL: "https://URL.firebaseio.com"
});

admin.auth().createCustomToken("some-uid").then(function(customToken){
       console.log(customToken);
   }

I follow all the steps in the documentation 1. https://firebase.google.com/docs/admin/setup

But i am getting an error: Property 'createCustomToken' does not exist

enter image description here

what can i do?

0

There are 0 answers