Getting Started with React Auth Lambda VPC
This vertical comes bundled with Nar — no separate download needed.
Configure Credentials
-
Open
{workspace}/{vertical}/services_config/nn_env.json. -
Set
JWT_SECRETto a unique value. -
Create an OAuth 2.0 Client ID (Web application) in the Google Cloud Console.
-
Add
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETtonn_env.json:{
"JWT_ALGORITHM": "HS256",
"JWT_SECRET": "your-unique-secret",
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
Configure VPC
This vertical's code.json includes a network block that places Lambda functions inside a VPC. Update the subnet and security group IDs in code.json to match your AWS environment:
{
"name": "auth",
"location": "orig/auth",
"network": {
"subnets": ["subnet-your-id-1", "subnet-your-id-2"],
"securityGroups": ["sg-your-id"]
}
}
See services.lambda — Network Configuration for details.
Deploy Services
-
In the UX, deploy the Auth service.
-
Copy the auth service URL from the deploy output.
-
In Google Cloud Console, add the Authorized redirect URI:
https://<auth-service-url>/oauth/loggedin
Deploy UI
- In the UX, deploy the UI.
- Open your site and log in to verify.
Your React source files are at {workspace}/{vertical}/ui/. See the React UI guide for project structure.
Related
- Environment Variables — Services receive region, site, bucket names, and service URLs automatically. Custom variables go in
nn_env.json. - Auth Service — more on Google OAuth configuration
- VPC Configuration — how
networkmaps to AWS VPC resources