Function: retryOrAddOrgs()

retryOrAddOrgs(orgConfigs): Promise<BootstrapResponse>

Use this method to add or retry initialization for one or more Salesforce orgs. The orgs are validated and merged using the specified configurations. On completion, the SDK flow is restarted.

Parameters 

orgConfigs: OrgConfig[]

A list of OrgConfig objects to add or retry.

Returns 

Promise<BootstrapResponse>

A promise that resolves with resulting states in a OrgStatesMap.

Multi-org Usage 

Use this function to add new orgs or retry failed ones after initial SDK initialization:

1import {retryOrAddOrgs, Status} from '@salesforce/analytics-embedding-sdk';
2
3// Add new orgs or retry failed ones
4const response = await retryOrAddOrgs([
5    {
6        authCredential: "https://org3.salesforce.com/secur/frontdoor.jsp?sid=123...",
7        orgUrl: "https://org3.lightning.force.com"  // Must be Lightning URL
8    },
9    {
10        authCredential: "https://org4.salesforce.com/secur/frontdoor.jsp?sid=123...",
11        orgUrl: "https://org4.lightning.force.com"  // Must be Lightning URL
12    }
13]);
14
15// Check response status
16if (response.status === Status.SUCCESS) {
17    console.log('All orgs initialized successfully');
18} else if (response.status === Status.PARTIAL_SUCCESS) {
19    console.log('Some orgs initialized successfully');
20    // Check individual org states
21    response.orgStates?.forEach((state, orgUrl) => {
22        console.log(`${orgUrl}: ${state.state}`);
23    });
24}

Note: The response format is the same as initializeAnalyticsSdk, with orgStates containing the status of each org.