Environments

TalkJS has two environments, Test Mode and Live Mode. Test Mode is intended for developing and testing your application, whereas Live Mode is for use in production.

When you sign up for TalkJS, you get access to Test Mode, which is free to use. Your chat UI will have a banner saying "You're in TalkJS Test Mode", and your data will not be backed up as frequently as in Live Mode.

To use TalkJS in your production environment, you need to subscribe to one of our plans and switch to Live Mode.

Switch your application to Live Mode

To switch your application to Live Mode, you will need to access the settings for Live Mode. To do this, go to the Settings page in your TalkJS dashboard, and toggle the switch in the top bar of the dashboard to Viewing Live Mode:

Toggle for switching between Test and Live Mode

Then follow these steps:

  • In the code for your TalkJS session, replace your Test Mode App ID with the Live Mode App ID. You can find your App ID on the Settings page of the dashboard. The exact location of your App ID in your code will depend on your implementation of TalkJS, but may look something like this:

    1const me = new Talk.User({
    2 id: 12345,
    3 name: 'Dennis Vargas',
    4});
    5const session = new Talk.Session({
    6 appId: '<APP_ID>', // change to the Live Mode App ID
    7 me: me,
    8});
  • If you use the REST API, you will also need to update your secret key in your requests. You can find your secret key on the Settings page of the dashboard.

  • If you have created or modified any roles, you will need to publish them to the live environment to use them there. To publish your roles, go to the Chat UI page of the dashboard and click the Edit roles link. Click the Copy to live button for the roles you want to copy to the live environment.

  • If you have created or modified any themes in the Theme Editor, you will need to publish them to the live environment to use them there. To publish your themes, go to the Themes page of the dashboard and click the Copy to live button for the themes you want to copy to the live environment.

Tip: If your application or website has multiple environments—for instance, a test environment and a production environment—that use different TalkJS environments, it might be a good idea to store your Live and Test TalkJS credentials as environment variables in your code. This allows you to try out new themes, roles, or any other customization on your test environment before going live to production with any changes.