Skip to content

Commit

Permalink
Merge pull request #96 from Alokit-Innovations/akg/events_endpoint
Browse files Browse the repository at this point in the history
Change events endpoint to vibinex server
  • Loading branch information
tapishr authored Mar 21, 2024
2 parents 788f8ca + 4e6f51f commit 68a3ca3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions backgroundScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ chrome.runtime.onInstalled.addListener(() => {
const environment = "prod";
// const environment = "dev";

// Set the website and backend URLs based on the environment.
// Set the website URL based on the environment.
const websiteUrl = (environment === "dev") ? "http://localhost:3000" : "https://vibinex.com";
const backendUrl = (environment === "dev") ? "http://localhost:8080" : "https://gcscruncsql-k7jns52mtq-el.a.run.app";

// Store the website and backend URLs in Chrome's local storage.
chrome.storage.local.set({ websiteUrl, backendUrl }).then(_ => console.log(`Website URL set to ${websiteUrl};`));
// Store the website URL in Chrome's local storage.
chrome.storage.local.set({ websiteUrl }).then(_ => console.log(`Website URL set to ${websiteUrl};`))
.catch(error => console.error(`Failed to set website URL: ${error}`));

// Make an API call to the backend to create a Rudderstack event when the extension is installed.
chrome.storage.local.get(["userId"]).then(({ userId }) => {
const body = {
userId: userId ? userId : "anonymous-id", // Use the stored userId or "anonymous-id" if not available.
function: 'chrome-extension-installed'
}
const url = `${backendUrl}/chrome/events`;
const url = `${websiteUrl}/api/extension/events`;
fetch(url, {
method: "POST",
headers: {
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Vibinex Code Review",
"version": "1.1.3",
"version": "1.1.4",
"manifest_version": 3,
"description": "Personalization and context for pull requests on GitHub & Bitbucket",
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsRm6EaBdHDBxVjt9o9WKeL9EDdz1X+knDAU5uoZaRsXTmWjslhJN9DhSd7/Ys4aJOSN+s+5/HnIHcKV63P4GYaUM5FhETHEWORHlwIgjcV/1h6wD6bNbvXi06gtiygE+yMrCzzD93/Z+41XrwMElYiW2U5owNpat2Yfq4p9FDX1uBJUKsRIMp6LbRQla4vAzH/HMUtHWmeuUsmPVzcq1b6uB1QmuJqIQ1GrntIHw3UBWUlqRZ5OtxI1DCP3knglvqz26WT5Pc4GBDNlcI9+3F0vhwqwHqrdyjZpIKZ7iaQzcrovOqUKuXs1J3hDtXq8WoJELIqfIisY7rhAvq6b8jQIDAQAB",
Expand Down Expand Up @@ -44,4 +44,4 @@
]
}
]
}
}
4 changes: 2 additions & 2 deletions scripts/orchestrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Functionality:
* 1. Logs the updated tab URL for debugging purposes.
* 2. Checks if the user is logged in when on GitHub or Bitbucket. If not, a warning is displayed.
* 3. Retrieves the 'backendUrl' from Chrome local storage.
* 3. Retrieves the 'websiteUrl' from Chrome local storage.
*
* For GitHub:
* - If on a specific repository page (e.g., https://github.com/mui/mui-toolpad), it displays a floating action button.
Expand Down Expand Up @@ -132,4 +132,4 @@ const orchestrator = async (tabUrl, websiteUrl, userId) => {
}
}
}
};
};

0 comments on commit 68a3ca3

Please sign in to comment.