ExpressJS
Learn how to integrate Wristband authentication with your Express server using our SDK.
An Express server integration uses the Backend Server pattern to handle authentication in your app. Learn more in our Integration Patterns for Backend Server documentation.
Goals
After completing this guide you will have learned the following concepts:
- Building an ExpressJS backend API
- Integrating the Wristband Auth SDK with your ExpressJS backend
- Basic session management with your ExpressJS backend
- Connecting a front-end application using React/NextJS to the ExpressJS backend
- Implementing Cross Site Request Forgery (CSRF) protection
Prerequisites
- Node.js (v18.x or later)
- Package manager such as npm, yarn, or pnpm
- Express.js (v4.x or later)
- React (vanilla or NextJS)
Set Up Express
If you are starting your app from scratch, you will need to setup an Express project by following their installation documentation.
Handling Cookies in Express
Ensure your Express server is configured to deal with cookies. The Wristband SDK expects the
req.cookies
object to be present on incoming requests, which the cookie-parser middleware can handle.
After your Express server is set up, you can install the Wristband Auth SDK.
Updated 1 day ago