branch-events-sdk
is a service designed to call the branch.io API route using Typescript. This project is licensed under MIT.
- Node.js
- a branch.io account with an application created.
- Branch IO key for the created application.
npm i @stack-finance/branch-events-sdk
Since this package is hosted on GitHub's npm registry, you must configure your .npmrc file in the consuming application:
- Create (or update)
.npmrc
in your project root and add the following line:@stack-finance:registry=https://npm.pkg.github.com
- Ensure you have an auth token to install private packages. You can use a GitHub Personal Access Token (PAT):
- Generate a token with the
read:packages
scope from GitHub Developer Settings. - Run the following command to authenticate:
npm login --scope=@stack-finance --registry=https://npm.pkg.github.com
- Alternatively, add this to your
~/.npmrc
(global config) or your project’s.npmrc
://npm.pkg.github.com/:_authToken=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN
- Generate a token with the
Before making any changes, please follow these strict guidelines:
-
Follow Semantic Versioning.
TL;DR:- Any fix that does not break expected behavior is a patch (
x.x.+1
). - Any new feature that does not break behavior is a minor version change (
x.+1.x
). - Any feature/fix that will break behavior is a major version change (
+1.x.x
).
- Any fix that does not break expected behavior is a patch (
-
Handle breaking changes carefully.
- Avoid breaking changes when possible.
- If necessary, deprecate a function before removing it.
- Introduce a new function to replace the deprecated one and update the documentation.
- Only if unavoidable, modify an existing function directly.
-
Ensure type definitions are updated.
- All functions must have proper TypeScript type annotations.
- If a function is deprecated, update its type definition accordingly.
. Optimize utility functions.
- If a function is only a 1-2 line simple operation, keep it inline.
- If it’s more than 2 lines and reused multiple times, move it to
utils/
.
Before publishing, ensure you are logged into the GitHub npm registry:
npm login --scope=@stack-finance --registry=https://npm.pkg.github.com
- Increment the package version following the Contributing guidelines.
- Run a dry-run to verify what will be published:
npm publish --dry-run
- If everything looks correct, publish the package:
npm publish
⚠️ Do not use--access public
, as this is a private package. - Update dependent services to use the latest version.