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
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,11 @@ export async function newSdkClientEntity(options: CreateInstanceParams) {
initialContext,
sdkConfig,
);
const { status } = await client.start({ timeout: timeout / 1000 });
const bootstrap = options.configuration.clientSide?.bootstrap;
const { status } = await client.start({
timeout: timeout / 1000,
...(bootstrap != null && { bootstrap }),
});
const failed = status !== 'complete';
if (failed && !options.configuration.initCanFail) {
client.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default class TestHarnessWebSocket {
'client-per-context-summaries',
'track-hooks',
'fdv1-fallback',
'bootstrap',
];

break;
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/node-client/contract-tests/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ app.get('/', (req: Request, res: Response) => {
'wrapper',
'fdv1-fallback',
'client-event-source-http-errors',
'bootstrap',
],
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ export async function newSdkClientEntity(options: CreateInstanceParams): Promise
initialContext,
sdkConfig,
);
const startResult = await client.start({ timeout: timeout / 1000 });
const bootstrap = options.configuration.clientSide?.bootstrap;
const startResult = await client.start({
timeout: timeout / 1000,
...(bootstrap != null && { bootstrap }),
});
const failed = startResult.status !== 'complete';
if (failed && !options.configuration.initCanFail) {
await client.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,13 @@ export async function newSdkClientEntity(options: CreateInstanceParams) {

let failed = false;
try {
const bootstrap = options.configuration.clientSide?.bootstrap;
await Promise.race([
client.identify(initialContext, { timeout: timeout / 1000, waitForNetworkResults: true }),
client.identify(initialContext, {
timeout: timeout / 1000,
waitForNetworkResults: true,
...(bootstrap != null && { bootstrap }),
}),
new Promise((_resolve, reject) => {
setTimeout(reject, timeout);
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default class TestHarnessWebSocket {
'track-hooks',
'fdv1-fallback',
'client-event-source-http-errors',
'bootstrap',
];

break;
Expand Down
6 changes: 5 additions & 1 deletion packages/sdk/react/contract-tests/app/ClientRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export default function ClientRoot({ children }: { children: React.ReactNode })
sdkConfig,
);

const { status } = await client.start({ timeout: timeout / 1000 });
const bootstrap = params.configuration.clientSide?.bootstrap;
const { status } = await client.start({
timeout: timeout / 1000,
...(bootstrap != null && { bootstrap }),
});

if (status === 'failed' && !params.configuration.initCanFail) {
client.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default class TestHarnessWebSocket {
'client-per-context-summaries',
'track-hooks',
'fdv1-fallback',
'bootstrap',
];
break;

Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/vue/contract-tests/src/ClientEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,10 @@ export async function newSdkClientEntity(options: CreateInstanceParams) {
// Forward a harness-supplied secure mode hash as the `h` query parameter, only when
// the harness actually configured one.
const secureModeHash = options.configuration.clientSide?.hash;
const bootstrap = options.configuration.clientSide?.bootstrap;
const result = await client.start({
timeout: timeout / 1000,
...(bootstrap != null && { bootstrap }),
...(secureModeHash !== undefined && { identifyOptions: { hash: secureModeHash } }),
});
if (result.status !== 'complete') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default class TestHarnessWebSocket {
'secure-mode-hash',
'flag-change-listeners',
'fdv1-fallback',
'bootstrap',
];

break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export interface SDKConfigClientSideParams {
useReport?: boolean;
includeEnvironmentAttributes?: boolean;
hash?: string;
bootstrap?: unknown;
}

export interface SDKConfigEvaluationHookData {
Expand Down
Loading