0.10.47 • Published 1 year ago

@graphshieldhq/sidecar-js v0.10.47

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 year ago

GraphShield Sidecar for Node.js and Javascript

This module is an isomorphic package for Node.js and Javascript that

# Install the @graphshieldhq/sidecar-js npm package
npm install --save @graphshieldhq/sidecar-js
# Run your app with the sidecar
node --import @graphshieldhq/sidecar-js ./index.js

💡 Technically you can also import the sidecar module directly from your app using standard import statement, but we strongly recommend to preload it using the node runtime using the --import CLI argument. Refer to the --import documentation.

⚠️ Modules preloaded with --require will run before modules preloaded with --import.

This technique could be applied to your package.json start script:

{
  "scripts": {
    "start": "NODE_ENV=production node --import @graphshieldhq/sidecar-js ./index.js",
  }
}

Or to the ENTRYPOINT / CMD of your Dockerfile:

CMD ["node", "--import", "@graphshieldhq/sidecar-js", "./index.js"]

💡 By default, GraphShield sidecar modules are redirecting requests to proxy.graphshield.io. to learn more about its configuration options.