Auth0 Home Blog Docs

How do I access user’s picture within a hook?

const Chatkit = require('@pusher/chatkit-server')

const chatkit = new Chatkit.default({
  instanceLocator: 'v1:us1:6759a97c-d77e-4a06-89f4-3df55679df5e',
  key: 'KEY',

module.exports = function (user, context, cb) {

      id: `auth0|${}`,
      avatarURL: user.picture // <<<<< HOW DO I ACCESS PICTURE?
    .then(() => cb())
    .catch((err) => {

From within a Post User Registration hook I would like to access my user’s picture. However user.picture is undefined.

I tried adding picture to user_metadata in a rule but then I realised I cannot access user_metadata from the hook either :open_mouth:

What should I do?


Is it okay to bump this? Still not figured it out!


This may not be the exact answer your are looking for, but why can’t you just use a rule - you can definitely access the picture there, and it may be a better solution since as the picture changes, you will be able to keep it updated.

As you can see, the picture is easily accessible via a rule using the user.picture property


Also, the rule will fire when the user first signs up.