Skip to main content

Add Phone Authentication to Your Node.js Backend

Set up the backend API endpoints that your frontend SDK calls using the Glide Node.js SDK.

1

Install the SDK

Install the Glide Node.js SDK.

2

Initialize the Client

Create a GlideClient with your API key.

Store your API key in environment variables - never commit it to code.

3

Create API Endpoints

Create two endpoints for the frontend SDK:

  • /prepare - Initializes the auth session
  • /process - Routes to verifyPhoneNumber() or getPhoneNumber()
4

API Methods Reference

The SDK provides three main methods:

  • prepare() - Initialize authentication session
  • verifyPhoneNumber() - Confirm user owns a phone number
  • getPhoneNumber() - Retrieve phone from device
5

Error Handling

Handle specific error codes from the SDK.

6

Next Steps

npm install @glideidentity/glide-sdk
Read-only