3.2.1 • Published 2 years ago
@transfix/airhorn v3.2.1
Airhorn
Front end javascript version of the Transfix logging library. For more info, see the airhorn repo.
Use Airhorn in your project
Install the package
npm i @transfix/airhorn
Import datadog in your index.html:
<script type="text/javascript" src="https://www.datadoghq-browser-agent.com/datadog-logs-us.js"></script> <script> // Set your client token DD_LOGS.init({ clientToken: '<CLIENT_TOKEN>', forwardErrorsToLogs: true, }); </script>
See the datadog docs for more info.
Add a call to
airhorn.configure
somewhere in your app:airhorn.configure({ appName: 'some-app', environment: 'staging', sentryDSN: '<SENTRY_KEY>' })
The
environment
argument is typically something liketest
,staging
, orproduction
.
Publishing to the private Transfix npm account
The package is hosted at https://www.npmjs.com/package/@transfix/airhorn
The steps to update are:
git commit
your changesGet an npm readwrite token into your environment:
export NPM_TOKEN=$(aws secretsmanager get-secret-value --secret-id=prod/npm/token | jq -r .SecretString)
Bump the package version like so:
For a patch release (bug fixes: v1.0.0 -> v1.0.1):
npm run publish:airhorn:patch
For a minor release (new features: v1.0.0 -> v1.1.0):
npm run publish:airhorn:minor
For a major release (breaking changes: v1.0.0 -> v2.0.0):
npm run publish:airhorn:major
This will build, update the version, and publish all at once!