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        // Must be Lightning URL
8        orgUrl: "https://org3.lightning.force.com"  
9    },
10    {
11        authCredential: "https://org4.salesforce.com/secur/frontdoor.jsp?sid=123...",
12        // Must be Lightning URL
13        orgUrl: "https://org4.lightning.force.com"
14    }
15]);
16
17// Check response status
18if (response.status === Status.SUCCESS) {
19    console.log('All orgs initialized successfully');
20} else if (response.status === Status.PARTIAL_SUCCESS) {
21    console.log('Some orgs initialized successfully');
22    // Check individual org states
23    response.orgStates?.forEach((state, orgUrl) => {
24        console.log(`${orgUrl}: ${state.state}`);
25    });
26}

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

Note