Skip to content

Importing to create-react-app project #61

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

Closed
DeveloperAlly opened this issue May 16, 2018 · 2 comments
Closed

Importing to create-react-app project #61

DeveloperAlly opened this issue May 16, 2018 · 2 comments

Comments

@DeveloperAlly
Copy link

using npm install splunk sdk
then let splunkjs = require('splunk-sdk');

throws this error

  19 | // Declare a process environment so that we can set
  20 | // some globals here and have interop with node
> 21 | process.env = process.env || {};
  22 | 
  23 | module.exports = root = {
  24 |     Logger          : require('./lib/log').Logger,
@shakeelmohamed
Copy link
Contributor

Hi @AlisonWonderlandApps, this library was originally written to be imported into node projects. You'll want to run the compiled client directory through browserify (or similar tools) in order to use it with react.

See my comment on the JS logging repo for a starting point: splunk/splunk-javascript-logging#4 (comment)

Feel free to re-open this issue if you get stuck!

@fantavlik
Copy link
Contributor

For others that have asked for this, I have put up a PR to fix the error above and provide a create-react-app based example for how to use the SDK with React. Please have a look: #99

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

No branches or pull requests

3 participants