title: Twilio Programmable Chat with React Native
body: <p>I am trying to add Twilio Chat to my react native project. I'm getting an error with the name <code>SyncError</code> and code 0. I'm just trying to confirm it's connected at this point. Here's my basic setup.</p>
  
  <p>Import at the top</p>
  
  <pre class="lang-js prettyprint-override"><code>import {Client as Chat} from 'twilio-chat'
  </code></pre>
  
  <p>Inside my class</p>
  
  <pre class="lang-js prettyprint-override"><code>componentDidMount = async () =&gt; {
      console.log(Chat);
      const token = await AsyncStorage.getItem('auth-token');
      axios.get(config.apiUrl + '/chat/details', { headers: { Authorization: token } })
        .then(res =&gt; {
          console.log(res);
          Chat.create(res.data.twilioToken)
            .then(client =&gt; {
              console.log('client', client);
              this.subscribeToAllChatClientEvents(client);
            })
            .catch(error =&gt; {
              console.log('There was an error', error);
            });
        })
        .catch(err =&gt; {
          console.log(err);
        })
    }
  </code></pre>
  
  <p>The error also mentions an "Unhandled promise rejection" but I've included any <code>catch</code> blocks where needed.</p>
  
  <p>Thanks for any help.</p>