Skip to content

Commit

Permalink
Disable b64 for SDJ data on POST requests from browsers by default (#…
Browse files Browse the repository at this point in the history
…1352)

In POST requests this usually results in a smaller payload size, and is easier to debug.
The node tracker shares this setting across multiple emitters that may not all use POST so we can't make this assumption there.
  • Loading branch information
jethron authored Oct 9, 2024
1 parent af9992a commit 969f009
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/browser-tracker-core/src/tracker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function Tracker(

let // Tracker core
core = trackerCore({
base64: trackerConfiguration.encodeBase64,
base64: trackerConfiguration.encodeBase64 ?? trackerConfiguration.eventMethod !== 'post',
corePlugins: browserPlugins,
callback: sendRequest,
}),
Expand Down
2 changes: 1 addition & 1 deletion libraries/browser-tracker-core/src/tracker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export interface LocalStorageEventStoreConfigurationBase extends EventStoreConfi
export type TrackerConfiguration = {
/**
* Should event properties be base64 encoded where supported
* @defaultValue true
* @defaultValue false unless {@link EmitterConfigurationBase.eventMethod | eventMethod} is `get`
*/
encodeBase64?: boolean;
/**
Expand Down

0 comments on commit 969f009

Please sign in to comment.