Advanced Identify Features

Identify callback

Once your users have been successfully identified, it can sometimes makes sense to perform a followup action. Identify accepts a callback argument which allows you to call a function when identify has completed.

The callback will called regardless of if identification was successful or it failed, and does not pass any arguments.

To find your appID, log in above. You'll see your appID pre‑filled in the code snippet.

function myCallback() {
  console.log('The user was identified');
}

Canny('identify', {
  appID: 'YOUR_APP_ID',
  user: {
    avatarURL: viewer.avatarURL, // optional
    created: new Date(viewer.created).toISOString(), // optional
    email: viewer.email,
    id: viewer.id,
    name: viewer.name,
  },
}, myCallback);

Handling the routing to Canny yourself

You may need to perform other actions when a user clicks on your feedback link prior to redirecting them to your Canny board.

To do this, you can use the authenticateCannyLink function.

// Where YOUR_FEEDBACK_LINK is a URL to your Canny site, eg, 'http://feedback.canny.io' 
const authenticatedLink = Canny('authenticateCannyLink', YOUR_FEEDBACK_LINK);
window.open(authenticatedLink, '_blank', 'noopener'); // open Canny in a new tab