Skip to content

Commit 1eacdbe

Browse files
bkboothclaude
andcommitted
fix(pixel): thread identityType and traits through bootstrap handler
The bootstrap command handler only forwarded two args to identify(), silently dropping traits. Forward all three args to match the updated Pixel.identify(userId, identityType, traits?) signature. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 51ead4b commit 1eacdbe

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/audience/pixel/src/bootstrap.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ describe('bootstrap', () => {
6565
(window as Record<string, unknown>).__imtbl = [
6666
['init', { key: 'pk_test' }],
6767
['consent', 'full'],
68-
['identify', 'user-1', { email: 'a@b.com' }],
68+
['identify', 'user-1', 'passport', { email: 'a@b.com' }],
6969
];
7070

7171
require('./bootstrap');
7272

7373
expect(mockInit).toHaveBeenCalledWith({ key: 'pk_test' });
7474
expect(mockSetConsent).toHaveBeenCalledWith('full');
75-
expect(mockIdentify).toHaveBeenCalledWith('user-1', { email: 'a@b.com' });
75+
expect(mockIdentify).toHaveBeenCalledWith('user-1', 'passport', { email: 'a@b.com' });
7676
});
7777

7878
it('installs loader and handles new commands after load', () => {

packages/audience/pixel/src/bootstrap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function handleCommand(command: Command): void {
2727
pixel.identify(
2828
args[0] as string,
2929
args[1] as Parameters<Pixel['identify']>[1],
30+
args[2] as Parameters<Pixel['identify']>[2],
3031
);
3132
break;
3233
case 'consent':

0 commit comments

Comments
 (0)