refactor: update application name and related identifiers from Analytics to Pulse for consistent branding across the codebase

This commit is contained in:
Usman Baig
2026-01-19 17:20:01 +01:00
parent b8c129a62a
commit 5d867dd519
7 changed files with 11 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ import { cookies } from 'next/headers'
const AUTH_API_URL = process.env.NEXT_PUBLIC_AUTH_API_URL || process.env.NEXT_PUBLIC_AUTH_URL || 'http://localhost:8081'
// * Determine cookie domain dynamically
// * In production (on ciphera.net), we want to share cookies with subdomains (e.g. analytics-api.ciphera.net)
// * In production (on ciphera.net), we want to share cookies with subdomains (e.g. pulse-api.ciphera.net)
// * In local dev (localhost), we don't set a domain
const getCookieDomain = () => {
if (process.env.NODE_ENV === 'production') {
@@ -37,7 +37,7 @@ export async function exchangeAuthCode(code: string, codeVerifier: string, redir
body: JSON.stringify({
grant_type: 'authorization_code',
code,
client_id: 'analytics-app',
client_id: 'pulse-app',
redirect_uri: redirectUri,
code_verifier: codeVerifier,
}),

View File

@@ -82,7 +82,7 @@ export default function Chart({ data, prevData, stats, prevStats, interval }: Ch
const encodedUri = encodeURI(csvContent)
const link = document.createElement("a")
link.setAttribute("href", encodedUri)
link.setAttribute("download", `analytics_export_${new Date().toISOString().split('T')[0]}.csv`)
link.setAttribute("download", `pulse_export_${new Date().toISOString().split('T')[0]}.csv`)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)

View File

@@ -9,12 +9,12 @@ export const AUTH_API_URL = process.env.NEXT_PUBLIC_AUTH_API_URL || 'https://aut
export function getLoginUrl(redirectPath = '/auth/callback') {
const redirectUri = encodeURIComponent(`${APP_URL}${redirectPath}`)
return `${AUTH_URL}/login?client_id=analytics-app&redirect_uri=${redirectUri}&response_type=code`
return `${AUTH_URL}/login?client_id=pulse-app&redirect_uri=${redirectUri}&response_type=code`
}
export function getSignupUrl(redirectPath = '/auth/callback') {
const redirectUri = encodeURIComponent(`${APP_URL}${redirectPath}`)
return `${AUTH_URL}/signup?client_id=analytics-app&redirect_uri=${redirectUri}&response_type=code`
return `${AUTH_URL}/signup?client_id=pulse-app&redirect_uri=${redirectUri}&response_type=code`
}
export class ApiError extends Error {

View File

@@ -52,7 +52,7 @@ export async function initiateOAuthFlow(redirectPath = '/auth/callback') {
const redirectUri = encodeURIComponent(`${APP_URL}${redirectPath}`)
const loginUrl = `${AUTH_URL}/login?client_id=analytics-app&redirect_uri=${redirectUri}&response_type=code&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256`
const loginUrl = `${AUTH_URL}/login?client_id=pulse-app&redirect_uri=${redirectUri}&response_type=code&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256`
window.location.href = loginUrl
}
@@ -68,7 +68,7 @@ export async function initiateSignupFlow(redirectPath = '/auth/callback') {
const redirectUri = encodeURIComponent(`${APP_URL}${redirectPath}`)
const signupUrl = `${AUTH_URL}/signup?client_id=analytics-app&redirect_uri=${redirectUri}&response_type=code&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256`
const signupUrl = `${AUTH_URL}/signup?client_id=pulse-app&redirect_uri=${redirectUri}&response_type=code&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256`
window.location.href = signupUrl
}

4
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{
"name": "analytics-frontend",
"name": "pulse-frontend",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "analytics-frontend",
"name": "pulse-frontend",
"version": "0.1.0",
"dependencies": {
"@ciphera-net/ui": "^0.0.6",

View File

@@ -1,5 +1,5 @@
{
"name": "analytics-frontend",
"name": "pulse-frontend",
"version": "0.1.0",
"private": true,
"scripts": {

View File

@@ -19,7 +19,7 @@
}
const domain = script.getAttribute('data-domain');
const apiUrl = script.getAttribute('data-api') || 'https://analytics-api.ciphera.net';
const apiUrl = script.getAttribute('data-api') || 'https://pulse-api.ciphera.net';
// * Performance Monitoring (Core Web Vitals) State
let currentEventId = null;