@caravela-studio/glancy-next 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/dist/server.js +3 -2
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -33,12 +33,13 @@ export class ServerClient {
33
33
  /** Send several messages in one request (e.g. a backfill). */
34
34
  async batch(messages) {
35
35
  if (messages.length)
36
- await this.send(messages.map((m) => stamp(m, library)));
36
+ await this.send(messages.map((m) => stamp({ ...m, context: { source: "server", ...m.context } }, library)));
37
37
  }
38
38
  message(input) {
39
- const { timestamp, userId, ...rest } = input;
39
+ const { timestamp, userId, context, ...rest } = input;
40
40
  return stamp({
41
41
  ...rest,
42
+ context: { source: "server", ...context },
42
43
  userId: userId === undefined || userId === null ? null : String(userId),
43
44
  ...(timestamp ? { timestamp: new Date(timestamp).toISOString() } : {}),
44
45
  }, library);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caravela-studio/glancy-next",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Send product analytics from Next.js straight to Glancy",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -48,6 +48,6 @@
48
48
  "typescript": "^5.9.0"
49
49
  },
50
50
  "dependencies": {
51
- "@caravela-studio/glancy-web": "^0.1.0"
51
+ "@caravela-studio/glancy-web": "^0.1.2"
52
52
  }
53
53
  }