@walkeros/server-destination-snapchat 3.4.0-next-1776749829492

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,449 @@
1
+ {
2
+ "$meta": {
3
+ "package": "@walkeros/server-destination-snapchat",
4
+ "version": "3.4.0-next-1776749829492",
5
+ "type": "destination",
6
+ "platform": [
7
+ "server"
8
+ ],
9
+ "docs": "https://www.walkeros.io/docs/destinations/server/snapchat",
10
+ "source": "https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/snapchat/src"
11
+ },
12
+ "schemas": {
13
+ "mapping": {
14
+ "$schema": "http://json-schema.org/draft-07/schema#",
15
+ "type": "object",
16
+ "properties": {},
17
+ "additionalProperties": false
18
+ },
19
+ "settings": {
20
+ "$schema": "http://json-schema.org/draft-07/schema#",
21
+ "type": "object",
22
+ "properties": {
23
+ "accessToken": {
24
+ "type": "string",
25
+ "minLength": 1,
26
+ "description": "Long-lived Conversions API access token from Snapchat Ads Manager"
27
+ },
28
+ "pixelId": {
29
+ "type": "string",
30
+ "minLength": 1,
31
+ "description": "Snap Pixel ID"
32
+ },
33
+ "url": {
34
+ "type": "string",
35
+ "format": "uri",
36
+ "description": "Custom Conversions API base URL (default https://tr.snapchat.com/v3/)"
37
+ },
38
+ "action_source": {
39
+ "type": "string",
40
+ "enum": [
41
+ "WEB",
42
+ "MOBILE_APP",
43
+ "OFFLINE"
44
+ ],
45
+ "description": "Event action source (default WEB)"
46
+ },
47
+ "doNotHash": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "string"
51
+ },
52
+ "description": "User data fields to skip hashing (like ['em', 'ph'])"
53
+ },
54
+ "user_data": {
55
+ "type": "object",
56
+ "propertyNames": {
57
+ "type": "string"
58
+ },
59
+ "additionalProperties": {
60
+ "type": "string"
61
+ },
62
+ "description": "Mapping for user data fields (like { em: 'user.email' })"
63
+ },
64
+ "testMode": {
65
+ "type": "boolean",
66
+ "description": "When true, sends events to /events/validate instead of /events for testing"
67
+ }
68
+ },
69
+ "required": [
70
+ "accessToken",
71
+ "pixelId"
72
+ ],
73
+ "additionalProperties": false
74
+ }
75
+ },
76
+ "examples": {
77
+ "env": {
78
+ "push": {
79
+ "sendServer": {
80
+ "$code": "async()=>({ok:!0,data:{status:\"OK\",request_id:\"mock-123\"}})"
81
+ }
82
+ },
83
+ "simulation": [
84
+ "sendServer"
85
+ ]
86
+ },
87
+ "step": {
88
+ "addToCart": {
89
+ "in": {
90
+ "name": "product add",
91
+ "data": {
92
+ "id": "SKU-B2",
93
+ "name": "Running Shoes",
94
+ "price": 89.99,
95
+ "color": "blue"
96
+ },
97
+ "context": {
98
+ "shopping": [
99
+ "intent",
100
+ 0
101
+ ]
102
+ },
103
+ "globals": {
104
+ "pagegroup": "shop"
105
+ },
106
+ "custom": {
107
+ "completely": "random"
108
+ },
109
+ "user": {
110
+ "id": "us3r",
111
+ "device": "c00k13",
112
+ "session": "s3ss10n"
113
+ },
114
+ "nested": [
115
+ {
116
+ "entity": "product",
117
+ "data": {
118
+ "id": "SKU-B2",
119
+ "name": "Running Shoes",
120
+ "price": 89.99,
121
+ "quantity": 1
122
+ }
123
+ }
124
+ ],
125
+ "consent": {
126
+ "functional": true
127
+ },
128
+ "id": "1700000901000-gr0up-1",
129
+ "trigger": "click",
130
+ "entity": "product",
131
+ "action": "add",
132
+ "timestamp": 1700000901000,
133
+ "timing": 3.14,
134
+ "group": "gr0up",
135
+ "count": 1,
136
+ "version": {
137
+ "source": "3.4.0-next-1776749829492",
138
+ "tagging": 1
139
+ },
140
+ "source": {
141
+ "type": "server",
142
+ "id": "https://shop.example.com/products/running-shoes",
143
+ "previous_id": ""
144
+ }
145
+ },
146
+ "mapping": {
147
+ "name": "ADD_CART",
148
+ "data": {
149
+ "map": {
150
+ "custom_data": {
151
+ "map": {
152
+ "value": "data.price",
153
+ "currency": {
154
+ "value": "EUR"
155
+ },
156
+ "contents": {
157
+ "loop": [
158
+ "nested",
159
+ {
160
+ "condition": {
161
+ "$code": "e=>g(e)&&\"product\"===e.entity"
162
+ },
163
+ "map": {
164
+ "id": "data.id",
165
+ "item_price": "data.price",
166
+ "quantity": {
167
+ "key": "data.quantity",
168
+ "value": 1
169
+ }
170
+ }
171
+ }
172
+ ]
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ },
179
+ "out": [
180
+ [
181
+ "sendServer",
182
+ "https://tr.snapchat.com/v3/p1x3l1d/events?access_token=s3cr3t",
183
+ "{\"data\":[{\"event_name\":\"ADD_CART\",\"event_time\":1700000901,\"action_source\":\"WEB\",\"event_id\":\"1700000901000-gr0up-1\",\"user_data\":{},\"custom_data\":{\"value\":89.99,\"currency\":\"EUR\",\"contents\":[{\"id\":\"SKU-B2\",\"item_price\":89.99,\"quantity\":1}]},\"event_source_url\":\"https://shop.example.com/products/running-shoes\"}]}"
184
+ ]
185
+ ]
186
+ },
187
+ "lead": {
188
+ "in": {
189
+ "name": "form submit",
190
+ "data": {
191
+ "type": "newsletter"
192
+ },
193
+ "context": {
194
+ "dev": [
195
+ "test",
196
+ 1
197
+ ]
198
+ },
199
+ "globals": {
200
+ "lang": "elb"
201
+ },
202
+ "custom": {
203
+ "completely": "random"
204
+ },
205
+ "user": {
206
+ "email": "user@example.com"
207
+ },
208
+ "nested": [
209
+ {
210
+ "entity": "child",
211
+ "data": {
212
+ "is": "subordinated"
213
+ },
214
+ "nested": [],
215
+ "context": {
216
+ "element": [
217
+ "child",
218
+ 0
219
+ ]
220
+ }
221
+ }
222
+ ],
223
+ "consent": {
224
+ "functional": true
225
+ },
226
+ "id": "1700000903000-gr0up-1",
227
+ "trigger": "test",
228
+ "entity": "form",
229
+ "action": "submit",
230
+ "timestamp": 1700000903000,
231
+ "timing": 3.14,
232
+ "group": "gr0up",
233
+ "count": 1,
234
+ "version": {
235
+ "source": "3.4.0-next-1776749829492",
236
+ "tagging": 1
237
+ },
238
+ "source": {
239
+ "type": "server",
240
+ "id": "https://example.com/contact",
241
+ "previous_id": ""
242
+ }
243
+ },
244
+ "mapping": {
245
+ "name": "SIGN_UP",
246
+ "data": {
247
+ "map": {
248
+ "user_data": {
249
+ "map": {
250
+ "em": "user.email"
251
+ }
252
+ },
253
+ "custom_data": {
254
+ "map": {
255
+ "sign_up_method": {
256
+ "value": "newsletter"
257
+ }
258
+ }
259
+ }
260
+ }
261
+ }
262
+ },
263
+ "out": [
264
+ [
265
+ "sendServer",
266
+ "https://tr.snapchat.com/v3/p1x3l1d/events?access_token=s3cr3t",
267
+ "{\"data\":[{\"event_name\":\"SIGN_UP\",\"event_time\":1700000903,\"action_source\":\"WEB\",\"event_id\":\"1700000903000-gr0up-1\",\"user_data\":{\"em\":\"b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514\"},\"custom_data\":{\"sign_up_method\":\"newsletter\"},\"event_source_url\":\"https://example.com/contact\"}]}"
268
+ ]
269
+ ]
270
+ },
271
+ "pageView": {
272
+ "in": {
273
+ "name": "page view",
274
+ "data": {
275
+ "domain": "www.example.com",
276
+ "title": "walkerOS documentation",
277
+ "referrer": "https://www.walkeros.io/",
278
+ "search": "?foo=bar",
279
+ "hash": "#hash",
280
+ "id": "/docs/"
281
+ },
282
+ "context": {
283
+ "dev": [
284
+ "test",
285
+ 1
286
+ ]
287
+ },
288
+ "globals": {
289
+ "pagegroup": "docs"
290
+ },
291
+ "custom": {
292
+ "completely": "random"
293
+ },
294
+ "user": {
295
+ "id": "us3r",
296
+ "device": "c00k13",
297
+ "session": "s3ss10n"
298
+ },
299
+ "nested": [
300
+ {
301
+ "entity": "child",
302
+ "data": {
303
+ "is": "subordinated"
304
+ },
305
+ "nested": [],
306
+ "context": {
307
+ "element": [
308
+ "child",
309
+ 0
310
+ ]
311
+ }
312
+ }
313
+ ],
314
+ "consent": {
315
+ "functional": true
316
+ },
317
+ "id": "1700000902000-gr0up-1",
318
+ "trigger": "load",
319
+ "entity": "page",
320
+ "action": "view",
321
+ "timestamp": 1700000902000,
322
+ "timing": 3.14,
323
+ "group": "gr0up",
324
+ "count": 1,
325
+ "version": {
326
+ "source": "3.4.0-next-1776749829492",
327
+ "tagging": 1
328
+ },
329
+ "source": {
330
+ "type": "server",
331
+ "id": "https://example.com/docs/",
332
+ "previous_id": ""
333
+ }
334
+ },
335
+ "out": [
336
+ [
337
+ "sendServer",
338
+ "https://tr.snapchat.com/v3/p1x3l1d/events?access_token=s3cr3t",
339
+ "{\"data\":[{\"event_name\":\"page view\",\"event_time\":1700000902,\"action_source\":\"WEB\",\"event_id\":\"1700000902000-gr0up-1\",\"user_data\":{},\"custom_data\":{},\"event_source_url\":\"https://example.com/docs/\"}]}"
340
+ ]
341
+ ]
342
+ },
343
+ "purchase": {
344
+ "in": {
345
+ "name": "order complete",
346
+ "data": {
347
+ "id": "ORD-300",
348
+ "total": 249.99,
349
+ "currency": "EUR"
350
+ },
351
+ "context": {
352
+ "shopping": [
353
+ "complete",
354
+ 0
355
+ ]
356
+ },
357
+ "globals": {
358
+ "pagegroup": "shop"
359
+ },
360
+ "custom": {
361
+ "completely": "random"
362
+ },
363
+ "user": {
364
+ "id": "user-123",
365
+ "device": "device-456"
366
+ },
367
+ "nested": [
368
+ {
369
+ "entity": "product",
370
+ "data": {
371
+ "id": "SKU-A1",
372
+ "name": "Widget Pro",
373
+ "price": 124.99,
374
+ "quantity": 2
375
+ }
376
+ }
377
+ ],
378
+ "consent": {
379
+ "functional": true
380
+ },
381
+ "id": "1700000900000-gr0up-1",
382
+ "trigger": "load",
383
+ "entity": "order",
384
+ "action": "complete",
385
+ "timestamp": 1700000900000,
386
+ "timing": 3.14,
387
+ "group": "gr0up",
388
+ "count": 1,
389
+ "version": {
390
+ "source": "3.4.0-next-1776749829492",
391
+ "tagging": 1
392
+ },
393
+ "source": {
394
+ "type": "server",
395
+ "id": "https://shop.example.com/checkout/complete",
396
+ "previous_id": ""
397
+ }
398
+ },
399
+ "mapping": {
400
+ "name": "PURCHASE",
401
+ "data": {
402
+ "map": {
403
+ "custom_data": {
404
+ "map": {
405
+ "value": "data.total",
406
+ "currency": {
407
+ "key": "data.currency",
408
+ "value": "EUR"
409
+ },
410
+ "transaction_id": "data.id",
411
+ "contents": {
412
+ "loop": [
413
+ "nested",
414
+ {
415
+ "condition": {
416
+ "$code": "e=>g(e)&&\"product\"===e.entity"
417
+ },
418
+ "map": {
419
+ "id": "data.id",
420
+ "item_price": "data.price",
421
+ "quantity": {
422
+ "key": "data.quantity",
423
+ "value": 1
424
+ }
425
+ }
426
+ }
427
+ ]
428
+ }
429
+ }
430
+ },
431
+ "user_data": {
432
+ "map": {
433
+ "external_id": "user.id"
434
+ }
435
+ }
436
+ }
437
+ }
438
+ },
439
+ "out": [
440
+ [
441
+ "sendServer",
442
+ "https://tr.snapchat.com/v3/p1x3l1d/events?access_token=s3cr3t",
443
+ "{\"data\":[{\"event_name\":\"PURCHASE\",\"event_time\":1700000900,\"action_source\":\"WEB\",\"event_id\":\"1700000900000-gr0up-1\",\"user_data\":{\"external_id\":\"fcdec6df4d44dbc637c7c5b58efface52a7f8a88535423430255be0bb89bedd8\"},\"custom_data\":{\"value\":249.99,\"currency\":\"EUR\",\"transaction_id\":\"ORD-300\",\"contents\":[{\"id\":\"SKU-A1\",\"item_price\":124.99,\"quantity\":2}]},\"event_source_url\":\"https://shop.example.com/checkout/complete\"}]}"
444
+ ]
445
+ ]
446
+ }
447
+ }
448
+ }
449
+ }
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@walkeros/server-destination-snapchat",
3
+ "description": "Snapchat Conversions API server destination for walkerOS",
4
+ "version": "3.4.0-next-1776749829492",
5
+ "license": "MIT",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.mjs",
10
+ "require": "./dist/index.js"
11
+ },
12
+ "./dev": {
13
+ "types": "./dist/dev.d.ts",
14
+ "import": "./dist/dev.mjs",
15
+ "require": "./dist/dev.js"
16
+ },
17
+ "./walkerOS.json": "./dist/walkerOS.json",
18
+ "./examples": {
19
+ "types": "./dist/examples/index.d.ts",
20
+ "import": "./dist/examples/index.mjs",
21
+ "require": "./dist/examples/index.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist/**"
26
+ ],
27
+ "scripts": {
28
+ "build": "tsup --silent",
29
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
30
+ "dev": "jest --watchAll --colors",
31
+ "typecheck": "tsc --noEmit",
32
+ "lint": "eslint \"**/*.ts*\"",
33
+ "test": "jest",
34
+ "update": "npx npm-check-updates -u && npm update"
35
+ },
36
+ "dependencies": {
37
+ "@walkeros/core": "3.4.0-next-1776749829492",
38
+ "@walkeros/server-core": "3.4.0-next-1776749829492"
39
+ },
40
+ "devDependencies": {
41
+ "@walkeros/collector": "3.4.0-next-1776749829492"
42
+ },
43
+ "repository": {
44
+ "url": "git+https://github.com/elbwalker/walkerOS.git",
45
+ "directory": "packages/server/destinations/snapchat"
46
+ },
47
+ "author": "elbwalker <hello@elbwalker.com>",
48
+ "homepage": "https://github.com/elbwalker/walkerOS#readme",
49
+ "bugs": {
50
+ "url": "https://github.com/elbwalker/walkerOS/issues"
51
+ },
52
+ "walkerOS": {
53
+ "type": "destination",
54
+ "platform": [
55
+ "server"
56
+ ],
57
+ "docs": "https://www.walkeros.io/docs/destinations/server/snapchat"
58
+ },
59
+ "keywords": [
60
+ "walkerOS",
61
+ "walkerOS-destination",
62
+ "destination",
63
+ "server",
64
+ "snapchat",
65
+ "conversions-api",
66
+ "capi",
67
+ "snap-pixel",
68
+ "analytics"
69
+ ],
70
+ "funding": [
71
+ {
72
+ "type": "GitHub Sponsors",
73
+ "url": "https://github.com/sponsors/elbwalker"
74
+ }
75
+ ]
76
+ }