Skip to content

Instantly share code, notes, and snippets.

@kunalshetye
Last active December 13, 2024 12:53
Show Gist options
  • Save kunalshetye/69866ff2929f42e79712f4088c8f2d40 to your computer and use it in GitHub Desktop.
Save kunalshetye/69866ff2929f42e79712f4088c8f2d40 to your computer and use it in GitHub Desktop.
Extract Graph Keys as environment variables in Chrome Console
let items = document.querySelectorAll(".dashboard__column div:nth-child(3) > table > tbody > tr");
let output = Array();
output.push(``); // to get rid of Chrome VM2xxx output in the console
output.push(`OPTIMIZELY_GRAPH_GATEWAY=${items[0].lastChild.innerText}`);
output.push(`OPTIMIZELY_GRAPH_APP_KEY=${items[1].lastChild.innerText}`);
output.push(`OPTIMIZELY_GRAPH_SECRET=${items[2].lastChild.firstChild.value}`);
output.push(`OPTIMIZELY_GRAPH_SINGLE_KEY=${items[3].lastChild.innerText}`);
console.log(output.join("\n"));
@kunalshetye
Copy link
Author

kunalshetye commented Dec 13, 2024

Needs to be executed on the "Dashboard Page" of your SaaS CMS
Example output:
Screenshot 2024-12-13 at 13 47 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment