Experience-Monks / nextjs-boilerplate

Jam3 NextJS Generator for SPA, SSG, SSR and JAMStack applications
https://generator.jam3.net/
MIT License
107 stars 18 forks source link

[Feature] Add AWS RUM Integration #298

Closed alex-togo closed 1 year ago

alex-togo commented 1 year ago

This PR adds AWS RUM (real user monitoring) to the frontend boilerplate.

Env vars necessary to be added to CircleCI are found in the JS snippet given to you on the RUM page in the AWS management console. Since there are many env vars, we opted to use a single env var with JSON encoded values.

Here is an example of how the env var would look:

NEXT_PUBLIC_AWS_RUM='{"guestRoleArn":"arn:aws:iam::12345:role/cognito_unauthenticated_role","identityPoolId":"us-east-1:xxxxxx-xxxxx-xxxxx","endpoint":"https://dataplane.rum.us-east-1.amazonaws.com","region":"us-east-1","appId":"xxxxxxx-xxxx-xxxx-xxxx-xxxxxx","appVersion":"1.0.0"}'

This code will also record the user's journey, based on their navigation through the app using Next.js router.

NPM Page: https://www.npmjs.com/package/aws-rum-web Bundlephobia minified size: https://bundlephobia.com/package/aws-rum-web@1.15.0

User Journey Example (Home -> About -> Home):

image

Note: If the RUM service is not setup to run on localhost, you will get a 400 error. You'll need to use the devops boilerplate to set the domain as localhost. Otherwise, it will run on your specified domain.

experiencemonks-devops commented 1 year ago

[AUTOMATED] Latest version has been pushed to preview.

Preview deployed at https://preview-1472322.dev.nextjs-boilerplate.jam3.cloud.jam3.net

experiencemonks-devops commented 1 year ago

[AUTOMATED] Latest version has been pushed to preview.

Preview deployed at https://preview-ae6c134.dev.nextjs-boilerplate.jam3.cloud.jam3.net

experiencemonks-devops commented 1 year ago

[AUTOMATED] Latest version has been pushed to preview.

Preview deployed at https://preview-ca1ad80.dev.nextjs-boilerplate.jam3.cloud.jam3.net

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication