Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(webpack): set up basic example project to test plugin against #1207

Merged
merged 4 commits into from
Oct 13, 2023

Conversation

BethanyBerkowitz
Copy link
Contributor

@BethanyBerkowitz BethanyBerkowitz commented Oct 11, 2023

Status

READY

Description

In working on #1013, I found I needed a basic project to test sourcemap upload and deploy notifications. I decided to set up the project first so I could see the behavior on the existing package before making changes.

Steps to Test or Reproduce

> cd packages/webpack/example
> npm i
> npm run build

You should see

Uploaded main.js.map to Honeybadger API
Successfully sent deploy notification to Honeybadger API.

subzero10
subzero10 previously approved these changes Oct 12, 2023
Copy link
Member

@subzero10 subzero10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking, but I left some comments.

packages/webpack/example/webpack.config.js Outdated Show resolved Hide resolved
packages/webpack/example/package.json Outdated Show resolved Hide resolved
const Honeybadger = require('@honeybadger-io/js');

Honeybadger.configure({
apiKey: (prompt('Enter the API key for your Honeybadger project:')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since HONEYBADGER_API_KEY is required to be passed as an env variable for this example app, you could read it from there using the EnvironmentPlugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think that would work for our testing purposes, but I don't think it's the example we necessarily want to set for our users. From those docs it looks like this will put the API key into the bundled code as a string, which would expose it publicly.

I didn't intend this little example to be about the main HB functionality... really just about the sourcemap and deploy upload, but I still wouldn't want to publish something that if copy/pasted could cause user API keys to be public.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Gotcha.

Btw, API keys on the client side are exposed publicly anyway in some way or another. Best we can do is hide them under minified/uglified code, but they are exposed nevertheless.

@BethanyBerkowitz BethanyBerkowitz merged commit 78fe74f into master Oct 13, 2023
@BethanyBerkowitz BethanyBerkowitz deleted the BKB/webpack-example branch October 13, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants