Closer
  • Closer guides and FAQ
  • Back to Closer
  • Guide
    • Onboarding
      • Configure your widget
      • Install the widget on your website
      • Invite your team
      • Get the mobile app
      • Advanced Closer widget integration
    • Zacznij używać Closer
      • Przewodnik po platformie
      • Rozmowy
        • Inbox
    • Zarządzaj doradcami
      • Zaproś doradców firmy
      • Ustawienia doradcy
      • Grupuj doradców
    • Skonfiguruj routing
      • Wprowadzenie
      • Dodaj tagi
      • Reguły tagowania
      • Dodaj reguły tagowania
      • Grupuj tagi
      • Ustawienia grupy tagów
    • Getting deeper in dashboard
      • Conversations
        • Inbox
        • Conversation data
    • Getting deeper in widget
      • Widget guides
    • Notifications
    • How to
      • Schedule online meetings
      • Click to call
      • Tagging
      • Proactive messages
      • Set up skill-based routing
      • Manage your team’s workload
      • Force new user everytime in widget
      • User authorization callbacks
      • On deinit callback
      • Identify leads
      • Reports
      • SLA
      • Customer typing preview
      • Push out data with Webhooks
      • Routing
      • Widget OAuth configuration
      • Forms configuration
      • Org configuration API
      • Org configuration fields
      • Configure OMNI integration
      • Elasticsearch business logs
      • Elasticsearch security logs
      • Manage widget button
    • Contact us
    • Supported browsers
    • Upcoming features drafts
      • Business events structure (JSON) - Draft
  • FAQ
    • General
    • Bots
    • Calendar
    • Random
Powered by GitBook
On this page

Was this helpful?

  1. Guide
  2. How to

User authorization callbacks

You can provide a function to be called after user succesful user authorization in widget.

closer.init({
  orgId: "00000000-0000-0000-0000-000000000000",
  onUserAuthorizationSuccess: (authorizationResult: UserAuthorizationResult) => console.log("USER AUTHORIZED")
});

Authorization result object:

interface UserAuthorizationResult {
  roomId: string;
  idToken?: string;
}

If you use OAuth for customers authorization that provides ID Token, it will be available in callback.

closer.init({
  orgId: "00000000-0000-0000-0000-000000000000",
  onUserAuthorizationSuccess: (authorizationResult: {idToken?: string}) => console.log(idToken)
});

Sometimes your user might not authorize, especially when using OAuth. There is other callback for that situation.

closer.init({
  orgId: "00000000-0000-0000-0000-000000000000",
  onUserAuthorizationFailed: () => console.log("User authorization failed")
});
PreviousForce new user everytime in widgetNextOn deinit callback

Last updated 2 years ago

Was this helpful?