Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/gravity-server-destination.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@walkeros/server-destination-gravity': minor
---

New Gravity server destination for the Conversions API of ads in AI assistants.
The mapped event name is the Gravity event (standard or custom); email and phone
are normalised and SHA-256 hashed, the Gravity click parameters are passed
through, and an `error` status inside a 200 answer fails the push.
`test_event_code` validates events without recording them.
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions packages/server/destinations/gravity/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<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-gravity

Server-side conversions to the [Gravity](https://trygravity.com) Conversions API
(ads in AI assistants), with hashed email and phone, the Gravity click
parameters and deduplication on the walkerOS event id.

[Documentation](https://www.walkeros.io/docs/destinations/server/gravity) &bull;
[NPM Package](https://www.npmjs.com/package/@walkeros/server-destination-gravity)
&bull;
[Source Code](https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/gravity)

## Installation

```bash
npm install @walkeros/server-destination-gravity
```

## Quick start

```json
{
"version": 4,
"flows": {
"default": {
"config": { "platform": "server" },
"destinations": {
"gravity": {
"package": "@walkeros/server-destination-gravity",
"config": {
"settings": {
"apiKey": "$secret.GRAVITY_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/gravity**

## 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
5 changes: 5 additions & 0 deletions packages/server/destinations/gravity/jest.config.mjs
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 };
76 changes: 76 additions & 0 deletions packages/server/destinations/gravity/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "@walkeros/server-destination-gravity",
"description": "Gravity (ads in AI assistants) Conversions API 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/gravity"
},
"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/gravity"
},
"keywords": [
"walkerOS",
"walkerOS-destination",
"destination",
"server",
"gravity",
"ai-ads",
"conversions-api",
"analytics"
],
"funding": [
{
"type": "GitHub Sponsors",
"url": "https://github.com/sponsors/elbwalker"
}
]
}
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 { destinationGravity } from '..';
import { examples, schemas } from '../dev';

describe('gravity conformance', () => {
beforeEach(() => {
jest.useRealTimers();
});

it('conforms', async () => {
await conformance('destination', destinationGravity, {
profile: 'http',
examples: examples.step,
schema: schemas.settings,
settings: examples.minimal.settings,
minimal: examples.minimal,
root: path.join(__dirname, '..', '..'),
});
});
});
Loading