Skip to main content
Sign in with Text is a ready-to-use login flow built with the Accounts SDK. It lets you:
  • Get the Text user’s email, account ID, or organization ID.
  • Receive an access_token for API calls, using the implicit grant.
  • Receive a code for the authorization code grant with PKCE, which you then exchange for access_token and refresh_token.
Because an OAuth client can only authorize accounts in the organization that created it, Sign in with Text fits an internal tool your own team signs in to — for example, an internal dashboard or browser extension — rather than a public login button for arbitrary Text customers. Users start the flow by clicking a Sign in with Text button. If they aren’t signed in, they’re asked to sign in, then to grant your app access to the scopes you configured. Depending on how you initialize the SDK, your app then receives either an access_token (implicit grant) or a code you exchange for access_token and refresh_token (authorization code grant with PKCE).

Implementing Sign in with Text

Step 1: Create an OAuth client

Go to Settings → API access → OAuth clients and create a new OAuth client. Configure:
  • Display name — a name to identify your OAuth client.
  • Redirect URI whitelist — the exact URL of the page where users click Sign in with Text. The button doesn’t work with any other URL.
  • Access scopes — the scopes your app needs. See OAuth scopes for the full list.

Step 2: Install the SDK

NPM module installation
NPM module import

Step 3: Add the login button

By default, the SDK requests an access_token directly (the implicit grant):
Handle the login button click
Use prompt: "consent" to force the app to ask for access to certain resources again during testing.
To get a refresh token instead, initialize the SDK with response_type: "code" and PKCE enabled, then exchange the returned code yourself:
Handle the login button click, with PKCE
See PKCE support in the Accounts SDK reference for the full set of PKCE configuration options.

Accounts SDK

The Accounts SDK (@livechat/accounts-sdk) provides the classes and methods used in the Sign in with Text flow. For the full API reference — including AccountsSDK, Popup, Redirect, PKCE configuration, and response formats — see the Accounts SDK documentation.