Repository navigation
feat: Reditus server destination (referral conversions and payments) #763
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
Open
laurentdav
wants to merge
3
commits into
elbwalker:main
Choose a base branch
from
laurentdav:feat/destination-reditus
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| '@walkeros/server-destination-reditus': minor | ||
| --- | ||
|
|
||
| New Reditus server destination for affiliate and referral programs. Each rule | ||
| sends a referral conversion (`POST /v2/tracking/conversion`, with `gr_id` or an | ||
| affiliate/advocate slug) or a payment (`POST /v1/payments`, amount in cents, | ||
| idempotent on the event id). An existing referral (409) or a customer who was | ||
| never referred (404) counts as delivered. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| <p align="left"> | ||
| <a href="https://www.walkeros.io"> | ||
| <img alt="walkerOS" title="walkerOS" src="https://www.walkeros.io/img/walkerOS_logo.svg" width="256px"/> | ||
| </a> | ||
| </p> | ||
|
|
||
| # @walkeros/server-destination-reditus | ||
|
|
||
| Server-side referral conversions and payments to | ||
| [Reditus](https://www.getreditus.com), the affiliate and referral platform: a | ||
| referred sign-up or demo becomes a conversion, a referred customer's payment is | ||
| credited to the partner. | ||
|
|
||
| [Documentation](https://www.walkeros.io/docs/destinations/server/reditus) • | ||
| [NPM Package](https://www.npmjs.com/package/@walkeros/server-destination-reditus) | ||
| • | ||
| [Source Code](https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/reditus) | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| npm install @walkeros/server-destination-reditus | ||
| ``` | ||
|
|
||
| ## Quick start | ||
|
|
||
| ```json | ||
| { | ||
| "version": 4, | ||
| "flows": { | ||
| "default": { | ||
| "config": { "platform": "server" }, | ||
| "destinations": { | ||
| "reditus": { | ||
| "package": "@walkeros/server-destination-reditus", | ||
| "config": { | ||
| "settings": { | ||
| "apiKey": "$secret.REDITUS_API_KEY" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| This quick start sets no consent: add `consent: { marketing: true }` to `config` | ||
| before you go live, see the docs. | ||
|
|
||
| ## Documentation | ||
|
|
||
| Full configuration, mapping, and examples live in the docs: | ||
| **https://www.walkeros.io/docs/destinations/server/reditus** | ||
|
|
||
| ## Contribute | ||
|
|
||
| Feel free to contribute by submitting an | ||
| [issue](https://github.com/elbwalker/walkerOS/issues), starting a | ||
| [discussion](https://github.com/elbwalker/walkerOS/discussions), or getting in | ||
| [contact](https://calendly.com/elb-alexander/30min). | ||
|
|
||
| ## License | ||
|
|
||
| MIT | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import baseConfig from '@walkeros/config/jest'; | ||
|
|
||
| const config = {}; | ||
|
|
||
| export default { ...baseConfig, ...config }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| { | ||
| "name": "@walkeros/server-destination-reditus", | ||
| "description": "Reditus affiliate and referral server destination for walkerOS", | ||
| "version": "4.9.0", | ||
| "license": "MIT", | ||
| "exports": { | ||
| ".": { | ||
| "types": "./dist/index.d.ts", | ||
| "import": "./dist/index.mjs", | ||
| "require": "./dist/index.js" | ||
| }, | ||
| "./dev": { | ||
| "types": "./dist/dev.d.ts", | ||
| "import": "./dist/dev.mjs", | ||
| "require": "./dist/dev.js" | ||
| }, | ||
| "./walkerOS.json": "./dist/walkerOS.json", | ||
| "./examples": { | ||
| "types": "./dist/examples/index.d.ts", | ||
| "import": "./dist/examples/index.mjs", | ||
| "require": "./dist/examples/index.js" | ||
| } | ||
| }, | ||
| "files": [ | ||
| "dist/**", | ||
| "CHANGELOG.md" | ||
| ], | ||
| "scripts": { | ||
| "build": "tsup --silent", | ||
| "clean": "rm -rf .turbo && rm -rf dist", | ||
| "dev": "jest --watchAll --colors", | ||
| "typecheck": "tsc --noEmit", | ||
| "lint": "eslint \"**/*.ts*\"", | ||
| "test": "jest", | ||
| "update": "npx npm-check-updates -u && npm update" | ||
| }, | ||
| "dependencies": { | ||
| "@walkeros/core": "4.9.0", | ||
| "@walkeros/server-core": "4.9.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@walkeros/collector": "4.9.0" | ||
| }, | ||
| "repository": { | ||
| "url": "git+https://github.com/elbwalker/walkerOS.git", | ||
| "directory": "packages/server/destinations/reditus" | ||
| }, | ||
| "author": "elbwalker <hello@elbwalker.com>", | ||
| "homepage": "https://github.com/elbwalker/walkerOS#readme", | ||
| "bugs": { | ||
| "url": "https://github.com/elbwalker/walkerOS/issues" | ||
| }, | ||
| "walkerOS": { | ||
| "type": "destination", | ||
| "platform": [ | ||
| "server" | ||
| ], | ||
| "docs": "https://www.walkeros.io/docs/destinations/server/reditus" | ||
| }, | ||
| "keywords": [ | ||
| "walkerOS", | ||
| "walkerOS-destination", | ||
| "destination", | ||
| "server", | ||
| "reditus", | ||
| "affiliate", | ||
| "referral", | ||
| "conversions" | ||
| ], | ||
| "funding": [ | ||
| { | ||
| "type": "GitHub Sponsors", | ||
| "url": "https://github.com/sponsors/elbwalker" | ||
| } | ||
| ] | ||
| } |
21 changes: 21 additions & 0 deletions
21
packages/server/destinations/reditus/src/__tests__/conformance.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import path from 'path'; | ||
| import { conformance } from '@walkeros/collector/dev'; | ||
| import { destinationReditus } from '..'; | ||
| import { examples, schemas } from '../dev'; | ||
|
|
||
| describe('reditus conformance', () => { | ||
| beforeEach(() => { | ||
| jest.useRealTimers(); | ||
| }); | ||
|
|
||
| it('conforms', async () => { | ||
| await conformance('destination', destinationReditus, { | ||
| profile: 'http', | ||
| examples: examples.step, | ||
| schema: schemas.settings, | ||
| settings: examples.minimal.settings, | ||
| minimal: examples.minimal, | ||
| root: path.join(__dirname, '..', '..'), | ||
| }); | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quick start sends every event to the destination without a mapping, so every conversion fails with a
mappingerror.The quick start has no
mappingordataconfiguration. The Reditus destination readsuidoremailand a referral identifier from top-leveldata. Without a mapping,datastaysundefined. Each event then fails withReditus conversion needs email or uid. Add a mapping rule for the registration event to the quick start. The rule key must match that event's entity and action. Itsdata.mapmust setuid,emailandgr_id.Suggested fix