NPM packages

Configure

To configure multiple instances, the method will depend on the NPM package / platform SDK. In general each SDK will support the instances prop on the SeekaProvider which allows providing an array of instances to install.

Standard root props (org, id, publicKey etc) cannot be used when providing the instances prop. All instances must be provided via the instances array prop.

To get org, id, and key for each instance, visit API settings in the Seeka app, ensuring that the correct organisation and brand is selected.

React example

src/App.jsx

+ const seekaInstances = [
+     // instance / brand 1
+     {
+         "org": "", // Org id
+         "id": "", // Instance ID
+         "key": "" // Public key
+     },
+     // instance / brand 2
+     {
+         "org": "", // Org id
+         "id": "", // Instance ID
+         "key": "" // Public key
+     }
+     // More instances can be added
+ ]

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  <React.StrictMode>
 -    <SeekaProvider org={seekaOrgId} publicKey={seekaPublicKey} id={seekaInstanceId}>
-+    <SeekaProvider instances={seekaInstances}>
+      <App />
    </SeekaProvider>
  </React.StrictMode>
);

Svelte example

src/routes/ layout.svelte
 <script lang="ts">
+ const seekaInstances = [
+     // instance / brand 1
+     {
+         "org": "", // Org id
+         "id": "", // Instance ID
+         "key": "" // Public key
+     },
+     // instance / brand 2
+     {
+         "org": "", // Org id
+         "id": "", // Instance ID
+         "key": "" // Public key
+     }
+     // More instances can be added
+ ]

  const seekaConfig = {
-    orgId: '(organisation ID)',
-    instanceId: '(instance ID)',
-    publicKey: '(public key)',
+    instances: seekaInstances
  };
 </script>

 <div class="app">
	<Header />

	<main>
-     <SeekaProvider
-       org={seekaConfig.orgId}
-       id={seekaConfig.instanceId}
-       publicKey={seekaConfig.publicKey}
-     >
+     <SeekaProvider
+       instances={seekaConfig.instances}
+     >
      {@render children()}
     </SeekaProvider>
	</main>
 </div>

Usage

See this doc for how to interact with the SDK in a multi-instance setup.