Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Cenadros committed Oct 17, 2024
1 parent a1f1eb4 commit d10db83
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 8 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"main": "dist/code.js",
"ui": "dist/index.html",
"editorType": ["figma"],
"networkAccess": { "allowedDomains": ["none"] },
"networkAccess": { "allowedDomains": ["https://bam.eu01.nr-data.net"] },
"documentAccess": "dynamic-page"
}
101 changes: 94 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"license": "MPL2.0",
"dependencies": {
"@create-figma-plugin/ui": "^3.2",
"@newrelic/browser-agent": "^1.269.0",
"base64-js": "^1.5",
"classnames": "^2.5",
"lru-cache": "^11.0",
Expand Down
2 changes: 2 additions & 0 deletions ui-src/context/useFigma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export const useFigma = (): UseFigmaHook => {
setExporting(false);
setStep(undefined);

window.newrelic.addPageAction('document-exported');

break;
}
case 'CUSTOM_FONTS': {
Expand Down
33 changes: 33 additions & 0 deletions ui-src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BrowserAgent } from '@newrelic/browser-agent/loaders/browser-agent';
import 'node_modules/@create-figma-plugin/ui/lib/css/base.css';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
Expand All @@ -6,6 +7,38 @@ import { App } from './App';
import './main.css';
import './reset.css';

const options = {
init: {
distributed_tracing: { enabled: true },
privacy: { cookies_enabled: true },
ajax: { deny_list: ['bam.eu01.nr-data.net'] }
},
loader_config: {
accountID: '4802918',
trustKey: '4802918',
agentID: '538644682',
licenseKey: 'NRJS-7627480baa9ae72a392',
applicationID: '538644682'
},
info: {
beacon: 'bam.eu01.nr-data.net',
errorBeacon: 'bam.eu01.nr-data.net',
licenseKey: 'NRJS-7627480baa9ae72a392',
applicationID: '538644682',
sa: 1
}
};

new BrowserAgent(options);

declare global {
interface Window {
newrelic: BrowserAgent;
}
}

window.newrelic.addPageAction('plugin-loaded');

createRoot(document.getElementById('root') as HTMLElement).render(
<StrictMode>
<App />
Expand Down

0 comments on commit d10db83

Please sign in to comment.