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 toverifyPhoneNumber()orgetPhoneNumber()
4
API Methods Reference
The SDK provides three main methods:
prepare()- Initialize authentication sessionverifyPhoneNumber()- Confirm user owns a phone numbergetPhoneNumber()- Retrieve phone from device
5
Error Handling
Handle specific error codes from the SDK.
6
Next Steps
Your backend is ready! Now set up the frontend.
npm install @glideidentity/glide-sdkRead-only